Open a file for editing :e path/to/file.txt
Return to Normal mode ESC or <CTRL>+C
Navigating around text
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| /** | |
| * @fileoverview A simple Google App Script to monitor Twitter followers | |
| * @version 1.0 | |
| * @author Twitter: @olaf_k | Github: olaf-k | |
| */ | |
| /** | |
| * Twitter screen name (without @) to monitor | |
| * @constant | |
| */ |
| /** | |
| * Retrieves all the rows in the active spreadsheet that contain data and logs the | |
| * values for each row. | |
| * For more information on using the Spreadsheet API, see | |
| * https://developers.google.com/apps-script/service_spreadsheet | |
| */ | |
| function readRows() { | |
| var sheet = SpreadsheetApp.getActiveSheet(); | |
| var rows = sheet.getDataRange(); | |
| var numRows = rows.getNumRows(); |
| # SYNTAX: | |
| var pattern = new RegExp(pattern, attributes); # attributes: g (global); i (case-sensitive); m (multiline matches) | |
| var pattern = /pattern/attributes; # same as above | |
| # BRACKETS: | |
| [...]: Any one character between the brackets. | |
| [^...]: Any one character not between the brackets. |
| // ensure the keys being passed is an array of key paths | |
| // example: 'a.b' becomes ['a', 'b'] unless it was already ['a', 'b'] | |
| const keys = ks => Array.isArray(ks) ? ks : ks.split('.') | |
| // traverse the set of keys left to right, | |
| // returning the current value in each iteration. | |
| // if at any point the value for the current key does not exist, | |
| // return the default value | |
| const deepGet = (o, kp, d) => keys(kp).reduce((o, k) => o && o[k] || d, o) |
| /* Ultra lightweight Github REST Client */ | |
| // original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
| const token = 'github-token-here' | |
| const githubClient = generateAPI('https://api.github.com', { | |
| headers: { | |
| 'User-Agent': 'xyz', | |
| 'Authorization': `bearer ${token}` | |
| } | |
| }) |