Skip to content

Instantly share code, notes, and snippets.

git config --global url.ssh://git@github.com/.insteadOf https://github.com/
@swizzley
swizzley / selectJson.go
Created January 19, 2022 19:29
sql to json
func (c Client) SelectJSON(query string) ([]byte, error) {
db, err := sql.Open(driver, c.DSN)
if err != nil {
return nil, err
}
defer db.Close()
rows, err := db.Query(query)
if err != nil {
return nil, err
}
@swizzley
swizzley / main.go
Last active January 25, 2022 15:38
go http server
import (
"os"
"encoding/json"
"log"
"html/template"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
)
var (
rtr *mux.Router
@swizzley
swizzley / 3box.gist
Created February 14, 2020 17:37
3box
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box.
✅ did:3:bafyreiavkirvzv76fpyg6dgt4xv5euczn5chtc7kdtkvxulp7oplnisbg4 ✅
Create your profile today to start building social connection and trust online at https://3Box.io/
@swizzley
swizzley / provision.sh
Created August 5, 2016 17:30
demo + plus
if [ ! "$(which node)" ]; then
sudo yum makecache fast &> /dev/null
if [ ! "$(yum repolist all|grep -i epel)" ]; then
sudo echo "[epel]" > /etc/yum.repos.d/epel.repo
sudo echo "name=EPEL" >> /etc/yum.repos.d/epel.repo
sudo echo "baseurl=$EPEL_BASE" >> /etc/yum.repos.d/epel.repo
sudo echo "gpgcheck=0" >> /etc/yum.repos.d/epel.repo
fi
sudo yum -y install nodejs
fi