Skip to content

Instantly share code, notes, and snippets.

asmega /
Created Jul 31, 2022
mac resize disk image
hdiutil resize -size 30g ~/path/to/file.sparsebundle
hdiutil resize -help
View gist:cff2c3ba56a23e3cf8d7
wget -k -E -r -l 10 -p -N -F -nH http://localhost:3000
wget -P build -k -E -r -l 10 -p -N -F -nH http://localhost:3000
asmega / process.rb
Last active Jul 18, 2021
ticktick csv export
View process.rb
require "csv"
require "pry"
rows ="./ticktick.csv", headers: true)
rows = { |row| row["Completed Time"].nil? }"./ticktick2.csv", "w") do |csv|
csv << rows[0].headers
rows.each do |row|
asmega / gist:7cd47caafc02a0ff51d83444ce98e014
Last active Jul 9, 2021
simplest way to upload csv google bigquery
View gist:7cd47caafc02a0ff51d83444ce98e014
docker pull google/cloud-sdk:latest
docker run --rm -it
gcloud auth activate-service-account --key-file=/google-service-account.json
# auto detect csv headers
# replace table contents with csv file
bq load --autodetect --replace mydb.mytable /data.csv
View gist:ca12594f47c2f77ab60c6dfe54ce83ee


Delete all containers

docker rm container $(docker ps -a -q)

Delete all images

asmega / .curlrc
Created Oct 27, 2011
default proxy for curl in .curlrc
View .curlrc
asmega /
Created Nov 23, 2020
prevent rails from logging to stdout
View gist:3085470b509b809a653e635844184cb6
# list indexes
curl -X GET "localhost:9200/_aliases"
# remove readonly
curl -X PUT "localhost:9200/recipes/_settings" -H 'Content-Type: application/json' -d'
"index": {
"blocks.read_only": false,
View gist:9cdc2f790abeea468e8f11d534df6cbd
PGDATA=/usr/local/var/postgres pg_ctl start
// psql client commands
SHOW server_version;
brew info node
# switch version
brew switch icu4c 63.1