Skip to content

Instantly share code, notes, and snippets.

Avatar
🥅
goal_net

Jacob Chapman chapmanjacobd

🥅
goal_net
View GitHub Profile
@chapmanjacobd
chapmanjacobd / gist:60bfc2f2a566fa424b33b170a9a59306
Created Apr 9, 2021
currency to country_code (ISO 4217 -> ISO 3166-2)
View gist:60bfc2f2a566fa424b33b170a9a59306
IRR 42184.605129723 IR
VND 23134.627249775 VN
UZS 10506.045380757 UZ
SLL 10149.470899471 SL
GNF 9913.4366925066 GN
LAK 9357.3170731708 LA
PYG 6283.6108610861 PY
KHR 4017.2774869111 KH
MGA 3783.5305719921 MG
COP 3639.404378896 CO
View xlsx2csv folder, all sheets
# pip install xlsx2csv
for file in (fd -eXLSX .)
xlsx2csv --all $file (basename $file | sed 's/\.[^.]*$//')
end
@chapmanjacobd
chapmanjacobd / UwU.sh
Created Mar 16, 2021
open mobile tabs from file
View UwU.sh
#!/bin/bash
exec am start --user 0 -a android.intent.action.VIEW -n org.mozilla.fennec_fdroid/.App -d "$1" >/dev/null
#!/bin/bash
head -20 ../d/00_Metadata/tabs.txt | xargs -n1 -t sh ./open-in-firefox.sh
sed -i -e 1,20d ../d/00_Metadata/tabs.txt
@chapmanjacobd
chapmanjacobd / bq_fetch_dataset_schema.fish
Created Mar 11, 2021
Fetch BigQuery Schema for all tables in a dataset
View bq_fetch_dataset_schema.fish
function bq_fetch_dataset_schema --argument ds
for i in (bq ls -n 9999 --format="json" $ds | jq -r '.[].tableReference.tableId')
bq show --schema --format=prettyjson $ds.$i > $ds.$i &
end
end
@chapmanjacobd
chapmanjacobd / struct.sql
Created Mar 10, 2021
BigQuery GeoJSON Export Query
View struct.sql
SELECT boundary_id, TO_JSON_STRING((SELECT AS STRUCT
'Feature' as type,
b.id as id,
st_asgeojson(geom) as geometry,
(SELECT AS STRUCT my_geo_json_property as value) as properties
))
from aggregate.stats s
join reference.boundaries b on b.id = s.id
View xd75re.json
{"version":1,"notes":"","documentation":"\"This file is a QMK Configurator export. You can import this at <https://config.qmk.fm>. It can also be used directly with QMK's source code.\n\nTo setup your QMK environment check out the tutorial: <https://docs.qmk.fm/#/newbs>\n\nYou can convert this file to a keymap.c using this command: `qmk json2c {keymap}`\n\nYou can compile this keymap using this command: `qmk compile {keymap}`\"\n","keyboard":"xd75","keymap":"xk","layout":"LAYOUT_ortho_5x15","layers":[["KC_GRV","KC_1","KC_2","KC_3","KC_4","KC_5","KC_MINS","LT(2,KC_ESC)","KC_EQL","KC_6","KC_7","KC_8","KC_9","KC_0","KC_DEL","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_PSCR","KC_BSLS","KC_LBRC","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_RBRC","KC_BSPC","KC_A","KC_S","KC_D","KC_F","KC_G","KC_WH_U","KC_UP","KC_LSPO","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_LEFT","KC_DOWN","KC_RGHT","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_RSFT","KC_LCTL","KC_LCTL","KC_LAL
@chapmanjacobd
chapmanjacobd / gist:a8ef679516d4266e8f756897b56e581d
Created Dec 18, 2020
Global LightBG Desert Sepia Medium Contrast
View gist:a8ef679516d4266e8f756897b56e581d
/* AGENT_SHEET */
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
/* AGENT_SHEET */
@namespace html url(http://www.w3.org/1999/xhtml);
@namespace xul url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@chapmanjacobd
chapmanjacobd / gist:a9249e1fa0393230fa2680414f2b20da
Created Nov 14, 2020
Cat all the files in a git repo without cloning
View gist:a9249e1fa0393230fa2680414f2b20da
curl -s -H "Accept:application/vnd.github.v3.raw" https://api.github.com/repos/AbhishekSinhaCoder/Collection-of-Useful-Scripts/contents/ |
jq .[].download_url -r |
xargs -L1 sh -c 'curl "$0" 2>/dev/null | bat --paging=always'
View mv_sequentially.fish
for file in (fd -tf -uu)
set rel (dirname (realpath --relative-to=(pwd) $file))
set f (basename $file)
mkdir -p /home/xk/Videos/$rel
mv $file /home/xk/Videos/$rel/$f
end
View gist:6fea40459f27f514156bd553e9d87422
fd -tf -S-1mb -E map . node_modules/package/ -E '*.map' -E '*.d.ts' -E LICENSE -x cat |less -FSRXc