Skip to content

Instantly share code, notes, and snippets.

@topaztee
topaztee / drop_test_dbs.sh
Created Jan 5, 2021
script to delete all test databases
View drop_test_dbs.sh
# drop all test databases
sql="select datname from pg_database where datname like '%test_%'"
dbDelNames=`psql -U postgres -t -A -c "$sql"`
for dbName in ${dbDelNames[@]}
do
echo -e "\n\n[INFO] Drop $dbName.\n"
dropdb $dbName
done
View gist:ba8afe0e6e8d0a088dcc49e5f89d7dc8
Show all resolved comments in a Github Pull Request
document.querySelectorAll('span.Details-content--closed').forEach((e)=>{e.click()})
@topaztee
topaztee / convert-heic-photos-to-jpg.sh
Created Jul 31, 2020
iphone live photos are .heic formats which most sites dont accept. This script converts .heic files to jpg
View convert-heic-photos-to-jpg.sh
ls -1 *.heic | xargs -n 1 bash -c 'convert "$0" "${0%.*}.jpg"'
@topaztee
topaztee / main.go
Created Apr 28, 2019
go run main.go && go tool trace trace.out
View main.go
package main
import (
"fmt"
"os"
"runtime/trace"
)
func main() {
f, err := os.Create("trace.out")
View .zshrc
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
#settings for go path
export GOPATH=$HOME/go
PATH=$PATH:$GOPATH/bin
# Path to your oh-my-zsh installation.
export ZSH=/Users/topaztee/.oh-my-zsh
View slack.go
package slack
import (
"bytes"
"encoding/json"
"net/http"
)
func Firehose() Slack {
return Slack{