Skip to content

Instantly share code, notes, and snippets.

@donovank
donovank / forksync.sh
Created April 29, 2017 19:32
Forksync, a bash function to sync forked repos easily.
forksync() {
if [ ! -d ".git" ]; then
echo "Make sure your in the root of a github repo."
return
fi
if cat .git/config | grep -q 'remote "upstream"' .git/config; then
git add .
git stash
git fetch upstream
git rebase upstream/master
@donovank
donovank / forkwipe.sh
Last active April 29, 2017 20:13
Forksync's counter partner, forkwipe, fully restores from a master branch.
forkwipe () {
if [ ! -d ".git" ]; then
echo "Make sure your in the root of a github repo."
return
fi
if cat .git/config | grep -i -q 'remote "upstream"' .git/config; then
git fetch upstream
git checkout master
git reset --hard upstream/master
git push origin master --force
@donovank
donovank / server.go
Last active October 7, 2017 17:23
Minimalistic one-way TCP chat in Golang
package main
import (
"fmt"
"log"
"net"
)
var send = make(chan string)
@donovank
donovank / main.go
Created January 10, 2018 18:57
Shows Bitcoin transactions and updates when a new block is added to the blockchain.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"time"
)