Skip to content

Instantly share code, notes, and snippets.

View theophoric's full-sized avatar
💭
👾

theophoric theophoric

💭
👾
View GitHub Profile
@theophoric
theophoric / protocol_params.go
Last active July 1, 2021 11:36
GETH EVM opcode costs
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
@theophoric
theophoric / introrx.md
Created June 10, 2016 04:31 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@theophoric
theophoric / delete_merged_branches.md
Created September 11, 2015 00:10
Delete git branches that have been merged with maser

Local

git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d

Remote

git branch -r --merged | grep -v master | sed 's/origin\//:/' | xargs -n 1 git push origin

@theophoric
theophoric / gist:6b8b50b3aaeed0cd23bc
Created January 6, 2015 06:24
Procedure To Add a Swap File Under Linux
source : http://www.cyberciti.biz/faq/linux-add-a-swap-file-howto/
------------------------------------------------------------------
Procedure To Add a Swap File Under Linux
You need to use the dd command to create swap file. The mkswap command is used to set up a Linux swap area on a device or in a file.
Step #1: Login as the Root User
Open a terminal window (select Applications > Accessories > Terminal) or login to remote server using the ssh client. Switch to the root user by typing su - (or sudo -s) and entering the root password, when prompted:
@theophoric
theophoric / gist:9cdf706fcf8da3d4440d
Created June 27, 2014 18:47
delete all local branches that have been merged with master
git branch --merged master | grep -v "\* master" | xargs -n 1 git branch -d
@theophoric
theophoric / gist:d917551198035523d79a
Created June 11, 2014 20:28
reload osx audio kernal
sudo kextunload /System/Library/Extensions/AppleHDA.kext
sudo kextload /System/Library/Extensions/AppleHDA.kext
@theophoric
theophoric / gist:11264841
Created April 24, 2014 18:36
password --> md5 hash ( hex-encoded )
node -e "console.log(require('crypto').createHash('md5').update('YOUR PASSWORD HERE','utf8').digest('hex'))"
@theophoric
theophoric / foos.go
Created April 17, 2014 17:20
custom slices
package main
import "fmt"
type foo int
type foos []foo
func (f foos) first() foo {
if len(f) == 0 {
@theophoric
theophoric / storage.go
Last active November 17, 2022 13:02
How to store + decode objects in golang using leveldb + gob
package main
import (
"bytes"
"encoding/gob"
"fmt"
"time"
"github.com/syndtr/goleveldb/leveldb"
)