ctrl+/ - undo
ctrl+b - Switch to buffer
ctrl+c - special command to invoke "stuff"
ctrl+c ctrl+e - open Export Dispatcher
ctrl+c ctrl+s - schedule todo
ctrl+c ctrl+' - open buffer with code block
ctrl+x LEFT - switch to prev buffer
ctrl+x RIGHT - switch to next buffer
ctrl+x ctrl+e - evaluate line
View asset-update.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { createReadStream } = require("fs"); | |
const { join } = require("path"); | |
const contentful = require("contentful-management"); | |
const client = contentful.createClient({ | |
accessToken: process.env.CTF_TOKEN, | |
}); | |
async function main() { | |
const space = await client.getSpace("[SPACE_ID]"); |
View importJSON.gs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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(); |
View years.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Object.entries({ 1985: "foo", 1984: "bar", 1987: "baz" }) | |
.reverse() | |
.forEach(([year, content]) => console.log(year, content)); |
View smart-spread.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CPU = { | |
ram: '32gb', | |
ssd: '64gb', | |
micro: 'i7' | |
}; | |
const { ssd, ...newCPU } = CPU; | |
console.log(newCPU); | |
// Object { ram: "32gb", micro: "i7" } |
View switch.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const actionType = "LUNCH_ORDERED" | |
switch(actionType) { | |
case "LUNCH_ORDERED": | |
console.log("lunch") | |
case "DINNER_ORDERED": | |
console.log("dinner") | |
break | |
default: | |
console.log(":/") |
View keys.md
View README.md
Useful Twilio CLI snippets. :)
View console.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const msg = 'This is a great message'; | |
msg.replace('great', 'wonderful'); | |
// "This is a wonderful message" | |
// | |
// -> 'great' is replaced by 'wonderful' | |
msg.replace('great', '$&-$&'); | |
// "This is a great-great message" | |
// '$&' represents the matched substring |
View script.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p new-dir/{foo,baz}/whatever-{1,2}/{a,b}; | |
exa --tree new-dir; | |
# new-dir | |
# ├── baz | |
# │ ├── whatever-1 | |
# │ │ ├── a | |
# │ │ └── b | |
# │ └── whatever-2 |
View importjson.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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(); |
NewerOlder