Skip to content

Instantly share code, notes, and snippets.

@jquinter
jquinter / gist:d7cd3e2451d75e67fc3d51a2a9234d2c
Created December 8, 2019 15:32 — forked from gwixted/gist:4039676
Terminal Cheatsheet

Note

This contains commands shamelessly stolen from many authors. I will try to list all of them at the end of the file, but if I've missed someone, let me know.

Legend

  • UC/Use Case : a practical/frequently used example of the command in action (I find it easier to add commands into my daily workflow if I have an example that uses them in something I often do)

The Prompt


Navigating / Manipulating Text (emacs style terminal) [3]

@jquinter
jquinter / gist:f69c11af9ad938f7b2fb38af8cc9b919
Created April 1, 2019 15:25 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@jquinter
jquinter / config.yml
Last active April 15, 2018 12:29
Parse YAML from bash with sed and awk.
development:
adapter: mysql2
encoding: utf8
database: my_database
username: root
password:
apt:
- somepackage
- anotherpackage
@jquinter
jquinter / parse_yaml.sh
Last active September 15, 2019 04:08 — forked from pkuczynski/parse_yaml.sh
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034'|tr -d '\015')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
@jquinter
jquinter / CSS-Tools.md
Created January 19, 2016 20:10 — forked from nucliweb/CSS-Tools.md
CSS Tools
#!/bin/sh
#
# chmodr.sh
#
# author: Francis Byrne
# date: 2011/02/12
#
# Generic Script for recursively setting permissions for directories and files
# to defined or default permissions using chmod.
#