### Installation and Quickstart Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/uuid/README.md Instructions on how to install the uuid library and basic examples for generating a version 4 UUID using both ES6 module and CommonJS syntax. ```APIDOC ## Installation ```shell npm install uuid ``` ## Quickstart (ES6 Module) ```javascript import { v4 as uuidv4 } from 'uuid'; uuidv4(); // ⇨ '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d' ``` ## Quickstart (CommonJS) ```javascript const { v4: uuidv4 } = require('uuid'); uuidv4(); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed' ``` ``` -------------------------------- ### Development Setup Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/postcss-calc/README.md Clone the repository, install development dependencies, and run tests for contributing. ```bash git clone git@github.com:postcss/postcss-calc.git git checkout -b patch-1 npm install npm test ``` -------------------------------- ### Build and Setup Commands Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/lodash-es/release.md Standard commands for building, documenting, and installing project dependencies. ```bash npm run build npm run doc npm i ``` -------------------------------- ### Install fast-glob Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/fast-glob/README.md Install fast-glob using npm. This is the initial setup step before using the library. ```bash $ npm install --save fast-glob ``` -------------------------------- ### Clone and Setup Development Environment Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/@babel/core/node_modules/json5/README.md Commands to clone the repository and install dependencies for development. ```sh git clone https://github.com/json5/json5 cd json5 npm install ``` -------------------------------- ### Glob Installation and Basic Usage Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/glob/README.md Shows how to install the glob library using npm and provides a basic asynchronous example of matching files. ```APIDOC ## Installation Install with npm: ```bash npm i glob ``` ## Basic Usage (Asynchronous) ```javascript var glob = require("glob") // options is optional glob("**/*.js", options, function (er, files) { // files is an array of filenames. // If the `nonull` option is set, and nothing // was found, then files is ["**/*.js"] // er is an error object or null. }) ``` ``` -------------------------------- ### Installation and Basic Usage Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/hex-color-regex/README.md Instructions on how to install the hex-color-regex package and basic examples of its usage in JavaScript. ```APIDOC ## Install ``` npm i hex-color-regex --save npm test ``` ## Usage > For more use-cases see the [tests](./test.js) - `[opts]` **{Object}** pass `strict: true` for strict mode - `return` **{RegExp}** **Example** ```js var hexColorRegex = require('hex-color-regex') hexColorRegex().test('#f3f}') //=> true hexColorRegex({strict: true}).test('#f3f}') //=> false hexColorRegex().test('foo #f3f bar') //=> true hexColorRegex({strict: true}).test('foo #f3f bar') //=> false hexColorRegex().test('#a54f2c}') //=> true hexColorRegex({strict: true}).test('#a54f2c}') //=> false hexColorRegex().test('foo #a54f2c bar') //=> true hexColorRegex({strict: true}).test('foo #a54f2c bar') //=> false hexColorRegex().test('#ffff') //=> false hexColorRegex().test('ffff') //=> false hexColorRegex().test('#fff') //=> true hexColorRegex().test('fff') //=> false hexColorRegex().test('#4g1') //=> false hexColorRegex().test('4g1') //=> false hexColorRegex().test('#zY1') //=> false hexColorRegex().test('zY1') //=> false hexColorRegex().test('#7f68ZY') //=> false hexColorRegex().test('7f68ZY') //=> false hexColorRegex().test('ffffff') //=> false hexColorRegex().test('#afebe3') //=> true hexColorRegex().test('#AFEBE3') //=> true hexColorRegex().test('#3cb371') //=> true hexColorRegex().test('#3CB371') //=> true hexColorRegex().test('#556b2f') //=> true hexColorRegex().test('#556B2F') //=> true hexColorRegex().test('#708090') //=> true hexColorRegex().test('#7b68ee') //=> true hexColorRegex().test('#7B68EE') //=> true hexColorRegex().test('#eeeeee') //=> true hexColorRegex().test('#ffffff') //=> true hexColorRegex().test('#111111') //=> true hexColorRegex().test('#afe') //=> true hexColorRegex().test('#AF3') //=> true hexColorRegex().test('#3cb') //=> true hexColorRegex().test('#3CB') //=> true hexColorRegex().test('#b2f') //=> true hexColorRegex().test('#5B2') //=> true hexColorRegex().test('#708') //=> true hexColorRegex().test('#68e') //=> true hexColorRegex().test('#7AF') //=> true hexColorRegex().test('#777') //=> true hexColorRegex().test('#FFF') //=> true hexColorRegex().test('#fff') //=> true ``` ``` -------------------------------- ### Start a Timer with a Callback Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/version8.txt This example demonstrates starting a timer that will execute a specified function after a delay. The timer can be configured to fire once or repeatedly. ```vim let tempTimer = timer_start(4000, 'CheckTemp') ``` -------------------------------- ### Development setup with Gulp Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/request-promise-core/README.md Set up a development environment by cloning the repository, installing dependencies, and running Gulp tasks. Gulp watches files, lints code, and executes tests. ```bash # 1. clone the repo to your desktop, # 2. in the shell `cd` to the main folder, # 3. hit `npm install`, # 4. hit `npm install gulp -g` if you haven't installed gulp globally yet, and # 5. run `gulp dev`. (Or run `node ./node_modules/.bin/gulp dev` if you don't want to install gulp globally.) ``` -------------------------------- ### Start a Background Job Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/channel.txt Examples of starting jobs using shell commands or lists of arguments. Note that using a shell requires explicit invocation. ```vim let job = job_start(["/bin/sh", "-c", "echo hello"]) ``` ```vim let job = job_start('/bin/sh -c "echo hello"') ``` ```vim let job = job_start(['sh', '-c', "myserver /dev/null"]) ``` -------------------------------- ### Start a Timer with Arguments Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/version8.txt This example shows how to start a timer and pass arguments to the callback function. The `function()` construct is used to bind arguments to the function reference. ```vim let tempTimer = timer_start(4000, function('CheckTemp', ['out'])) ``` -------------------------------- ### Start Job in LSP Mode Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/channel.txt This example demonstrates starting a background job with input and output modes set to 'lsp' using `job_start()`. This configuration is essential for establishing communication with LSP servers that expect JSON-RPC messages over standard input/output. ```vimscript let cmd = ['clangd', '--background-index', '--clang-tidy'] let opts = {} let opts.in_mode = 'lsp' let opts.out_mode = 'lsp' let opts.err_mode = 'nl' let job = job_start(cmd, opts) ``` -------------------------------- ### Usage Example Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/caller-callsite/readme.md Demonstrates how to use caller-callsite to get the filename of the calling function. Ensure the 'callsites' package is installed as it's a dependency. ```javascript // foo.js const callerCallsite = require('caller-callsite'); module.exports = () => { console.log(callerCallsite().getFileName()); //=> '/Users/sindresorhus/dev/unicorn/bar.js' } ``` ```javascript // bar.js const foo = require('./foo'); foo(); ``` -------------------------------- ### GET Request with Promises and Callback Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/fsevents/node_modules/needle/README.md Illustrates using Needle with both Promises and callbacks for GET requests. The callback example shows accessing the JSON-decoded body directly. ```javascript // using promises needle('get', 'https://server.com/posts/12') .then(function(resp) { // ... }) .catch(function(err) { // ... }); // with callback needle.get('ifconfig.me/all.json', function(error, response, body) { if (error) throw error; // body is an alias for `response.body`, // that in this case holds a JSON-decoded object. console.log(body.ip_addr); }); ``` -------------------------------- ### Start Job via Method Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/channel.txt Demonstrates starting a job using the method syntax. ```vim BuildCommand()->job_start() ``` -------------------------------- ### Quick Start Example Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/@wasmer/wasm-transformer/lib/wasm-pack/web/README.md A basic example demonstrating how to use the `lower_i64_imports` function to modify a Wasm binary. ```APIDOC ## Quick Start For a larger example, see the simple [wasm_transformer_cli](../../examples/wasm_transformer_cli). ```rust use wasm_transformer::* use std::fs; // Read in a Wasm file as a Vec let mut wasm_binary = fs::read("./your_wasm_file.wasm").unwrap(); // Add trampoline functions to lower the i64 imports in the Wasm file let lowered_wasm = wasm_transformer::lower_i64_imports(wasm_binary); // Write back out the new Wasm file fs::write("./out.wasm", &lowered_wasm).expect("Unable to write file"); ``` ``` -------------------------------- ### getqflist() and getloclist() Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/quickfix.txt Examples demonstrating how to use getqflist() and getloclist() to retrieve information about quickfix and location lists. ```APIDOC ## getqflist() and getloclist() Examples ### Description Examples for using the |getqflist()| and |getloclist()| functions to obtain various attributes of quickfix and location lists. ### Method N/A (Vimscript functions) ### Endpoint N/A ### Parameters N/A ### Request Example ```vim " Get the window ID of the quickfix window echo getqflist({'winid' : 1}).winid " Get the window ID of the location list window echo getloclist(2, {'winid' : 1}).winid " Get the title of the current quickfix list echo getqflist({'title' : 0}).title " Get the identifier of the current quickfix list let qfid = getqflist({'id' : 0}).id " Get the identifier of the fourth quickfix list in the stack let qfid = getqflist({'nr' : 4, 'id' : 0}).id " Check whether a quickfix list with a specific identifier exists if getqflist({'id' : qfid}).id == qfid " Get the index of the current quickfix list in the stack let qfnum = getqflist({'nr' : 0}).nr " Get the items of a quickfix list specified by an identifier echo getqflist({'id' : qfid, 'items' : 0}).items " Get the number of entries in a quickfix list specified by an id echo getqflist({'id' : qfid, 'size' : 0}).size " Get the context of the third quickfix list in the stack echo getqflist({'nr' : 3, 'context' : 0}).context " Get the number of quickfix lists in the stack echo getqflist({'nr' : '$'}).nr " Get the number of times the current quickfix list is changed echo getqflist({'changedtick' : 0}).changedtick " Get the current entry in a quickfix list specified by an identifier echo getqflist({'id' : qfid, 'idx' : 0}).idx " Get all the quickfix list attributes using an identifier echo getqflist({'id' : qfid, 'all' : 0}) " Parse text from a List of lines and return a quickfix list let myList = ["a.java:10:L10", "b.java:20:L20"] echo getqflist({'lines' : myList}).items " Parse text using a custom 'efm' and return a quickfix list echo getqflist({'lines' : ['a.c#10#Line 10'], 'efm':'%f#%l#%m'}).items " Get the quickfix list window id echo getqflist({'winid' : 0}).winid " Get the quickfix list window buffer number echo getqflist({'qfbufnr' : 0}).qfbufnr " Get the context of the current location list echo getloclist(0, {'context' : 0}).context " Get the location list window id of the third window echo getloclist(3, {'winid' : 0}).winid " Get the location list window buffer number of the third window echo getloclist(3, {'qfbufnr' : 0}).qfbufnr " Get the file window id of a location list window (winnr: 4) echo getloclist(4, {'filewinid' : 0}).filewinid ``` ### Response #### Success Response (200) - **winid** (number) - The window ID. - **title** (string) - The title of the quickfix list. - **id** (number) - The identifier of the quickfix list. - **nr** (number) - The index of the quickfix list in the stack. - **items** (list) - A list of quickfix items. - **size** (number) - The number of entries in the quickfix list. - **context** (dict) - The context of the quickfix or location list. - **changedtick** (number) - The number of times the quickfix list has changed. - **idx** (number) - The index of the current entry. - **qfbufnr** (number) - The buffer number of the quickfix list window. - **filewinid** (number) - The window ID of the file associated with the location list entry. #### Response Example ```json { "winid": 1, "title": "Example Title", "id": 123, "nr": 1, "items": [ { "filename": "example.txt", "lnum": 10, "col": 5, "text": "Example error message" } ], "size": 1, "context": { "cmd": "grep example" }, "changedtick": 5, "idx": 0, "qfbufnr": 10, "filewinid": 2 } ``` ``` -------------------------------- ### is-data-descriptor Usage and Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/is-data-descriptor/README.md Demonstrates how to install and use the is-data-descriptor library, including various examples of valid and invalid data descriptors. ```APIDOC ## Install Install with [npm](https://www.npmjs.com/): ```sh $ npm i is-data-descriptor --save ``` ## Usage ```js var isDataDesc = require('is-data-descriptor'); ``` ## Examples `true` when the descriptor has valid properties with valid values. ```js // `value` can be anything isDataDesc({value: 'foo'}) isDataDesc({value: function() {}}) isDataDesc({value: true}) //=> true ``` `false` when not an object ```js isDataDesc('a') //=> false isDataDesc(null) //=> false isDataDesc([]) //=> false ``` `false` when the object has invalid properties ```js isDataDesc({value: 'foo', bar: 'baz'}) //=> false isDataDesc({value: 'foo', bar: 'baz'}) //=> false isDataDesc({value: 'foo', get: function(){}}) //=> false isDataDesc({get: function(){}, value: 'foo'}) //=> false ``` `false` when a value is not the correct type ```js isDataDesc({value: 'foo', enumerable: 'foo'}) //=> false isDataDesc({value: 'foo', configurable: 'foo'}) //=> false isDataDesc({value: 'foo', writable: 'foo'}) //=> false ``` ## Valid properties The only valid data descriptor properties are the following: * `configurable` (required) * `enumerable` (required) * `value` (optional) * `writable` (optional) To be a valid data descriptor, either `value` or `writable` must be defined. **Invalid properties** A descriptor may have additional _invalid_ properties (an error will **not** be thrown). ```js var foo = {}; Object.defineProperty(foo, 'bar', { enumerable: true, whatever: 'blah', // invalid, but doesn't cause an error get: function() { return 'baz'; } }); console.log(foo.bar); //=> 'baz' ``` ``` -------------------------------- ### Set up development environment Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/request-promise-native/README.md Commands to clone, install dependencies, and run the development gulp task. ```bash clone the repo to your desktop, in the shell `cd` to the main folder, hit `npm install`, hit `npm install gulp -g` if you haven't installed gulp globally yet, and run `gulp dev`. (Or run `node ./node_modules/.bin/gulp dev` if you don't want to install gulp globally.) ``` -------------------------------- ### Set Usage Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/core-js/README.md Examples demonstrating Set initialization, manipulation, and iteration. ```js var set = new Set(['a', 'b', 'a', 'c']); set.add('d').add('b').add('e'); console.log(set.size); // => 5 console.log(set.has('b')); // => true set.forEach(function(it){ console.log(it); // => 'a', 'b', 'c', 'd', 'e' }); set.delete('b'); console.log(set.size); // => 4 console.log(set.has('b')); // => false console.log(Array.from(set)); // => ['a', 'c', 'd', 'e'] var set = new Set([1, 2, 3, 2, 1]); for(var val of set)console.log(val); // => 1, 2, 3 for(var val of set.values())console.log(val); // => 1, 2, 3 for(var key of set.keys())console.log(key); // => 1, 2, 3 for(var [key, val] of set.entries()){ console.log(key); // => 1, 2, 3 console.log(val); // => 1, 2, 3 } ``` -------------------------------- ### Get Buffer Name for Current Window Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Example showing how to get the filename of the buffer in the current window using winbufnr() and bufname(). ```vimscript :echo "The file in the current window is " . bufname(winbufnr(0)) ``` -------------------------------- ### Filter List with Lambda Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/version8.txt This example uses a lambda function with the `filter()` function to create a new list containing only elements greater than 20. Lambdas provide a concise way to define inline functions. ```vim :call filter(mylist, {idx, val -> val > 20}) ``` -------------------------------- ### Heredoc-style String Assignment in Vimscript Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/version8.txt Provides an example of assigning a multi-line string to a Vimscript variable using a heredoc-style syntax. This avoids the need for manual quoting or line continuation characters. ```vimscript let lines =<< trim END line one line two END ``` -------------------------------- ### Example LOGIN.COM Configuration Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/os_vms.txt An example of a LOGIN.COM file demonstrating how to define the VIM logical and set up symbols for both terminal and GUI Vim, including specific geometry for the GUI. ```vms $ define/nolog VIM DKA0:[UTIL.VIM81] ``` ```vms $ vi*m :== mcr VIM:VIM.EXE ``` ```vms $ gv*im:== spawn/nowait/input=NLA0 mcr VIM:VIM.EXE -g -GEOMETRY 80x40 ``` ```vms $ set disp/create/node=192.168.10.202/trans=tcpip ``` -------------------------------- ### End of Vim9 Function Definition Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/version9.txt The :enddef command marks the end of a user function definition that was started with the :def command. ```vim :enddef ``` -------------------------------- ### Install a local plugin help file Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/usr_05.txt Commands to create the necessary directory structure and generate tags for a new plugin help file. ```vim :!mkdir ~/.vim :!mkdir ~/.vim/plugin :!cp /tmp/doit.vim ~/.vim/plugin ``` ```vim :!mkdir ~/.vim/doc ``` ```vim :!cp /tmp/doit.txt ~/.vim/doc ``` ```vim :helptags ~/.vim/doc ``` -------------------------------- ### Map to get current screen column Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Examples of mappings to get the current screen column. Note the different ways to display the result. ```vimscript nnoremap GG ":echom " .. screencol() .. "\n" ``` ```vimscript nnoremap GG :echom screencol() ``` ```vimscript nnoremap GG echom screencol() ``` -------------------------------- ### Build documentation with verb Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/base/node_modules/define-property/README.md Install global dependencies and run the verb command to generate documentation. ```sh npm install -g verbose/verb#dev verb-generate-readme && verb ``` -------------------------------- ### Vim9 Script Comment Example Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/vim9.txt In Vim9 script, comments start with a '#' symbol. This differs from legacy Vim script where comments start with a double quote. ```vimscript # declarations var count = 0 # number of occurrences ``` -------------------------------- ### setqflist() and setloclist() Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/quickfix.txt Examples demonstrating how to use setqflist() and setloclist() to set or modify quickfix and location lists. ```APIDOC ## setqflist() and setloclist() Examples ### Description Examples for using the |setqflist()| and |setloclist()| functions to set or modify various attributes of quickfix and location lists. ### Method N/A (Vimscript functions) ### Endpoint N/A ### Parameters N/A ### Request Example ```vim " Create an empty quickfix list with a title and a context let t = 'Search results' let c = {'cmd' : 'grep'} call setqflist([], ' ', {'title' : t, 'context' : c}) " Set the title of the current quickfix list call setqflist([], 'a', {'title' : 'Mytitle'}) " Change the current entry in the list specified by an identifier call setqflist([], 'a', {'id' : qfid, 'idx' : 10}) " Set the context of a quickfix list specified by an identifier call setqflist([], 'a', {'id' : qfid, 'context' : {'val' : 100}}) " Create a new quickfix list from a command output call setqflist([], ' ', {'lines' : systemlist('grep -Hn main *.c')}) " Parse text using a custom efm and add to a particular quickfix list call setqflist([], 'a', {'id' : qfid, 'lines' : ["a.c#10#L10", "b.c#20#L20"], 'efm':'%f#%l#%m'}) " Add items to the quickfix list specified by an identifier let newItems = [{'filename' : 'a.txt', 'lnum' : 10, 'text' : "Apple"}, {'filename' : 'b.txt', 'lnum' : 20, 'text' : "Orange"}] call setqflist([], 'a', {'id' : qfid, 'items' : newItems}) " Empty a quickfix list specified by an identifier call setqflist([], 'r', {'id' : qfid, 'items' : []}) " Free all the quickfix lists in the stack call setqflist([], 'f') " Set the title of the fourth quickfix list call setqflist([], 'a', {'nr' : 4, 'title' : 'SomeTitle'}) " Create a new quickfix list at the end of the stack " Set the title of the current location list call setloclist(0, [], 'a', {'title' : 'MyLocTitle'}) " Set the context of the current location list call setloclist(0, [], 'a', {'context' : {'cmd' : 'find'}}) " Add items to the current location list let newLocItems = [{'filename' : 'loc.txt', 'lnum' : 5, 'text' : "Location item"}] call setloclist(0, [], 'a', {'items' : newLocItems}) " Clear the current location list call setloclist(0, [], 'r') ``` ### Response #### Success Response (200) This function modifies the quickfix or location list in place. It does not return a value. #### Response Example N/A (void function) ``` -------------------------------- ### Popup Window Configuration Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/popup.txt Examples demonstrating how to configure popup windows using various functions and options. ```APIDOC ## Popup Window Configuration Examples ### Description Illustrative examples of configuring popup windows using Vimscript functions. ### Examples: 1. **Executing a command in a popup window's context:** ```vim call win_execute(winid, 'syntax enable') ``` 2. **Setting window-local options:** ```vim call setwinvar(winid, '&wrap', 0) ``` 3. **Setting buffer-local options:** ```vim call setbufvar(winbufnr(winid), '&filetype', 'java') ``` 4. **Using `popup_atcursor()` with custom options:** ```vim call popup_atcursor({what}, #{ pos: 'botleft', line: 'cursor-1', col: 'cursor', moved: 'WORD' }) ``` *Note: If `pos` is 'topleft', the default for `line` becomes 'cursor+1'.* 5. **Using `popup_beval()` with screen position calculation:** ```vim let pos = screenpos(v:beval_winnr, v:beval_lnum, v:beval_col) call popup_create({what}, #{ pos: 'botleft', line: pos.row - 1, col: pos.col, mousemoved: 'WORD' }) ``` ``` -------------------------------- ### Sign STS Request for Getting Session Token Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/aws4/README.md Sign an AWS STS request to get a session token. This example is useful for temporary security credentials. ```javascript request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'})) ``` -------------------------------- ### Install and Run Benchmarks Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/braces/README.md Commands to install development dependencies and execute the benchmark suite. ```bash npm i -d && npm benchmark ``` -------------------------------- ### Define function references Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/usr_41.txt Example setup for using function reference variables. ```vim def Right(): string return 'Right!' enddef def Wrong(): string return 'Wrong!' enddef ``` -------------------------------- ### Install dependencies and testing tools Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/node-libs-browser/node_modules/punycode/README.md Run these commands after cloning the repository to prepare the environment for development and testing. ```bash npm install --dev ``` ```bash npm install istanbul -g ``` -------------------------------- ### Usage of pkg-up Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/pkg-up/readme.md Asynchronous example showing how to retrieve the path of the closest package.json file. ```javascript // example.js const pkgUp = require('pkg-up'); (async () => { console.log(await pkgUp()); //=> '/Users/sindresorhus/foo/package.json' })(); ``` -------------------------------- ### Calculate Byte Offsets Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Get the byte count from the start of the buffer for a specific line. ```vim line2byte(line("$") + 1) GetLnum()->line2byte() ``` -------------------------------- ### Install on-finished Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/on-finished/README.md Use npm to install the package in your project. ```sh $ npm install on-finished ``` -------------------------------- ### Install and Test Project Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/postcss-modules-local-by-default/README.md Standard npm commands for installing dependencies and running tests. ```bash $ npm install $ npm test ``` -------------------------------- ### Quick Start Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/@wasmer/wasm-transformer/lib/wasm-pack/node/README.md A basic example demonstrating how to use the `lower_i64_imports` function to modify a Wasm binary. ```APIDOC ## Quick Start Here's a simple example of using the `wasm_transformer` crate: ```rust use wasm_transformer::* use std::fs; fn main() { // Read in a Wasm file as a Vec let wasm_file_path = "./input.wasm"; // Replace with your Wasm file path let mut wasm_binary = fs::read(wasm_file_path).expect("Failed to read Wasm file"); // Add trampoline functions to lower the i64 imports in the Wasm file let lowered_wasm = wasm_transformer::lower_i64_imports(wasm_binary); // Write back out the new Wasm file let output_file_path = "./out.wasm"; fs::write(output_file_path, &lowered_wasm).expect("Unable to write file"); println!("Successfully transformed Wasm file to {}", output_file_path); } ``` ``` -------------------------------- ### Example .env file Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/dotenv/README.md Create a .env file in your project's root directory to store environment-specific variables. Variables should be in the format NAME=VALUE on new lines. ```dosini DB_HOST=localhost DB_USER=root DB_PASS=s1mpl3 ``` -------------------------------- ### Install code-point-at Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/fsevents/node_modules/code-point-at/readme.md Install the package using npm. ```bash npm install --save code-point-at ``` -------------------------------- ### Get byte offset Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/node-addon-api/doc/typed_array.md Returns the starting byte offset of the array within the backing ArrayBuffer. ```cpp size_t Napi::TypedArray::ByteOffset() const; ``` -------------------------------- ### Parse generic methods with reserved names Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/@babel/parser/CHANGELOG.md Example of class methods named 'get' or 'set'. ```javascript class foo { get() {} } ``` -------------------------------- ### Start Vim with QuickFix file Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/quickfix.txt Launch Vim and load an error file into the QuickFix list. ```bash vim -q filename ``` -------------------------------- ### Get Column Position in Insert Mode Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt A mapping example to obtain the column position while in Insert mode. ```vim :imap :let save_ve = &ve \:set ve=all \:echo col(".") .. "\n" \let &ve = save_ve ``` -------------------------------- ### Retrieve Window Number for Buffer Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Examples of using bufwinnr() to get the window number associated with a buffer. ```vim echo "A window containing buffer 1 is " .. (bufwinnr(1)) ``` ```vim FindBuffer()->bufwinnr() ``` -------------------------------- ### Basic Vim Startup Commands Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/starting.txt Standard ways to launch the Vim editor from the command line. ```bash vim filename ``` ```bash vim [option | filename] .. ``` -------------------------------- ### Start Vim Tutor (Unix) Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/usr_01.txt Launches the interactive Vim tutorial from the command line on Unix-like systems. It teaches basic Vim commands hands-on. ```shell vimtutor ``` -------------------------------- ### Retrieve Window ID for Buffer Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Examples of using bufwinid() to get the window ID associated with a buffer. ```vim echo "A window containing buffer 1 is " .. (bufwinid(1)) ``` ```vim FindBuffer()->bufwinid() ``` -------------------------------- ### Install aws-sdk and publish build Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/fsevents/node_modules/node-pre-gyp/README.md Install the required AWS SDK and execute the package and publish command. ```bash npm install aws-sdk ``` ```bash node-pre-gyp package publish ``` -------------------------------- ### Quick Start Source: https://github.com/holzschu/a-shell/blob/master/Resources_mini/node_modules/@wasmer/wasm-transformer/lib/wasm-pack/node/README.md A basic example demonstrating how to use the `wasm_transformer` crate to lower i64 imports in a Wasm file. ```APIDOC ## Quick Start For a larger example, see the simple [wasm_transformer_cli](../../examples/wasm_transformer_cli). ```rust use wasm_transformer::* use std::fs; // Some Code here // Read in a Wasm file as a Vec let mut wasm_binary = fs::read(wasm_file_path).unwrap(); // Add trampoline functions to lower the i64 imports in the Wasm file let lowered_wasm = wasm_transformer::lower_i64_imports(wasm_binary); // Write back out the new Wasm file fs::write("./out.wasm", &lowered_wasm).expect("Unable to write file"); ``` ``` -------------------------------- ### Start VIMTUTOR Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/os_vms.txt Launch the Vim tutorial script on OpenVMS. ```DCL @vim:vimtutor ``` -------------------------------- ### Define Terminal Highlight Sequences Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/syntax.txt Examples of defining custom terminal escape sequences using the start argument. ```vim start=[27h;[r; ``` -------------------------------- ### Get Relative Time (Method) Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Calculates the time elapsed since a starting time. This is the method-based syntax for reltime(). ```shell GetStart()->reltime() ``` -------------------------------- ### Install snapdragon-util Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/snapdragon-util/README.md Installation commands for npm and yarn. ```sh $ npm install --save snapdragon-util ``` ```sh $ yarn add snapdragon-util ``` -------------------------------- ### Execute Ex commands on startup Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/starting.txt Use + or -c to run Ex commands after the first file is read. Multiple commands can be chained and are executed in order. ```bash vim "+set si" main.c vim "+find stdio.h" vim -c "set ff=dos" -c wq mine.mak ``` -------------------------------- ### Retrieve Buffer Name Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/builtin.txt Examples of using bufname() to get buffer names by number, pattern, or special identifiers. ```vim :echo bufname("3" + 0) ``` ```vim echo bufnr->bufname() ``` ```vim bufname("#") alternate buffer name bufname(3) name of buffer 3 bufname("%") name of current buffer bufname("file2") name of buffer where "file2" matches. ``` -------------------------------- ### Get Client IP Address (Behind Proxy) Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/ws/README.md When running behind a proxy like NGINX, use the 'X-Forwarded-For' header to obtain the client's IP address. This example splits the header to get the first IP. ```javascript wss.on('connection', function connection(ws, req) { const ip = req.headers['x-forwarded-for'].split(/\s*,\s*/)[0]; }); ``` -------------------------------- ### Map Usage Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/core-js/README.md Examples demonstrating Map initialization, manipulation, and iteration. ```js var a = [1]; var map = new Map([['a', 1], [42, 2]]); map.set(a, 3).set(true, 4); console.log(map.size); // => 4 console.log(map.has(a)); // => true console.log(map.has([1])); // => false console.log(map.get(a)); // => 3 map.forEach(function(val, key){ console.log(val); // => 1, 2, 3, 4 console.log(key); // => 'a', 42, [1], true }); map.delete(a); console.log(map.size); // => 3 console.log(map.get(a)); // => undefined console.log(Array.from(map)); // => [['a', 1], [42, 2], [true, 4]] var map = new Map([['a', 1], ['b', 2], ['c', 3]]); for(var [key, val] of map){ console.log(key); // => 'a', 'b', 'c' console.log(val); // => 1, 2, 3 } for(var val of map.values())console.log(val); // => 1, 2, 3 for(var key of map.keys())console.log(key); // => 'a', 'b', 'c' for(var [key, val] of map.entries()){ console.log(key); // => 'a', 'b', 'c' console.log(val); // => 1, 2, 3 } ``` -------------------------------- ### Execute Vim with Command-line Arguments Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/version5.txt Examples of mixing file arguments and options, including handling files that start with a dash. ```bash vim main.c -g ``` ```bash vim -g -- -main.c ``` -------------------------------- ### Vim Configuration Examples Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/change.txt Examples of setting 'formatoptions' for specific file types like C code or Mail/news. ```vim :set fo=croq ``` ```vim :set fo=tcrq ``` -------------------------------- ### Install delegates Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/fsevents/node_modules/delegates/Readme.md Command to install the library via npm. ```bash $ npm install delegates ``` -------------------------------- ### Symbol.for and Symbol.keyFor Example Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/core-js/README.md Illustrates how to use Symbol.for to create or retrieve a global symbol and Symbol.keyFor to get the key of a symbol. ```javascript var symbol = Symbol.for('key'); symbol === Symbol.for('key'); // true Symbol.keyFor(symbol); // 'key' ``` -------------------------------- ### is-accessor-descriptor: Accessor not a function Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/base/node_modules/is-accessor-descriptor/README.md These examples return false when the 'get' or 'set' properties are not functions, indicating an invalid accessor descriptor. ```js isAccessor({get: noop, set: 'baz'}) isAccessor({get: 'foo', set: noop}) isAccessor({get: 'foo', bar: 'baz'}) isAccessor({get: 'foo', set: 'baz'}) //=> false ``` -------------------------------- ### Creating Startup Aliases Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/starting.txt Example shell aliases to simulate different Vim startup modes when symbolic links are not supported. ```bash alias view vim -R alias gvim vim -g ``` -------------------------------- ### Usage Example for fsStat.stat Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/@nodelib/fs.stat/README.md Use the fsStat.stat function to asynchronously get file status. It returns a Promise that resolves with fs.Stats. ```javascript const fsStat = require('@nodelib/fs.stat'); fsStat.stat('path').then((stat) => { console.log(stat); // => fs.Stats }); ``` -------------------------------- ### Configure Vim Runtime Path Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/os_haiku.txt Example configuration for setting the help file path in .vimrc. ```vim :if version >= 500 : set helpfile=~/vim/runtime/doc/help.txt : syntax on :endif ``` -------------------------------- ### Configure horizontal scrolling and list characters Source: https://github.com/holzschu/a-shell/blob/master/Resources/vim/doc/options.txt Example setup for horizontal scrolling behavior and visual indicators for extended lines. ```vim :set nowrap sidescroll=1 listchars=extends:>,precedes:< :set sidescrolloff=1 ``` -------------------------------- ### Install dependencies and run tests Source: https://github.com/holzschu/a-shell/blob/master/Resources/node_modules/arr-diff/README.md Install project dependencies and execute the unit tests. ```sh $ npm install && npm test ```