Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@topaztee
topaztee / slack.go
Last active June 6, 2022 06:41
send slack message in golang
package slack
import (
"bytes"
"encoding/json"
"net/http"
)
func Firehose() Slack {
return Slack{
# 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
@topaztee
topaztee / main.go
Created April 28, 2019 12:19
go run main.go && go tool trace trace.out
package main
import (
"fmt"
"os"
"runtime/trace"
)
func main() {
f, err := os.Create("trace.out")
@topaztee
topaztee / convert-heic-photos-to-jpg.sh
Created July 31, 2020 04:55
iphone live photos are .heic formats which most sites dont accept. This script converts .heic files to jpg
ls -1 *.heic | xargs -n 1 bash -c 'convert "$0" "${0%.*}.jpg"'
Show all resolved comments in a Github Pull Request
document.querySelectorAll('span.Details-content--closed').forEach((e)=>{e.click()})
@topaztee
topaztee / drop_test_dbs.sh
Created January 5, 2021 21:00
script to delete all test databases
# 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
🌞 Morning 86 commits ████▊░░░░░░░░░░░░░░░░ 23.0%
🌆 Daytime 172 commits █████████▋░░░░░░░░░░░ 46.0%
🌃 Evening 92 commits █████▏░░░░░░░░░░░░░░░ 24.6%
🌙 Night 24 commits █▎░░░░░░░░░░░░░░░░░░░ 6.4%