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
@asmega
asmega / process.rb
Last active Sep 18, 2022
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
@asmega
asmega / script.sh
Created Nov 23, 2020
prevent rails from logging to stdout
View script.sh
unset RAILS_LOG_TO_STDOUT
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
View gist:cf1ff0e61b98c5349a5740f6a00bcdcb
# adjust brightness in smaller increments
Shift (⇧) + Option (alt) + Brightness
@asmega
asmega / run.sh
Created Jul 12, 2019
image manipulation
View run.sh
# correctly orientate images
mogrify -auto-orient *.jpg
View gist:ca12594f47c2f77ab60c6dfe54ce83ee

docker

Delete all containers

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

Delete all images