Skip to content

Instantly share code, notes, and snippets.

@asmega
asmega / index.sh
Created Jul 31, 2022
mac resize disk image
View index.sh
hdiutil resize -size 30g ~/path/to/file.sparsebundle
# HELP
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
asmega / process.rb
Last active Jul 18, 2021
ticktick csv export
View process.rb
require "csv"
require "pry"
rows = CSV.read("./ticktick.csv", headers: true)
rows = rows.select { |row| row["Completed Time"].nil? }
CSV.open("./ticktick2.csv", "w") do |csv|
csv << rows[0].headers
rows.each do |row|
@asmega
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 docker.io/google/cloud-sdk:latest
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

docker

Delete all containers

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

Delete all images

@asmega
asmega / .curlrc
Created Oct 27, 2011
default proxy for curl in .curlrc
View .curlrc
proxy=http://username:password@host:port
@asmega
asmega / script.sh
Created Nov 23, 2020
prevent rails from logging to stdout
View script.sh
unset RAILS_LOG_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;
View main.sh
brew info node
# switch version
brew switch icu4c 63.1