Skip to content

Instantly share code, notes, and snippets.

View adria0's full-sized avatar
💭
crustaceanin'

adria0.eth adria0

💭
crustaceanin'
View GitHub Profile
@adria0
adria0 / flattener.go
Created January 17, 2016 20:51
Golang flattener experiment
package main
import "fmt"
import "errors"
// Function to flatten nested arrays of integers
// Nested arrays of integers are encoded as arrays of interface{}
func flatten(elements []interface{}) ([]int, error) {
intarray := []int{}
@adria0
adria0 / reviewer-quick-and-dirty
Last active January 24, 2016 18:34
reviewer-quick-and-dirty
package main
import (
"fmt"
"os"
"strings"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
@adria0
adria0 / gist:ce08a68b3252728dd5e0
Created February 24, 2016 21:48
HerokuGoDeploy.txt
git init
heroku create
heroku buildpacks:set heroku/go
echo web: $GITPROJECT > Procfile
echo ... > main.go
#install:
# # Add Godeps dependencies to GOPATH and PATH
# - export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace:$GOPATH"
# - export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH"

Keybase proof

I hereby claim:

  • I am adriamb on github.
  • I am adriamb (https://keybase.io/adriamb) on keybase.
  • I have a public key whose fingerprint is 39DA 93D8 FEF4 B00E C687 27C4 D7F8 2B09 292B 5A03

To claim this, I am signing this object:

0x8C1f0D9e2e7CeA99f34259a49AC180d24C2Ff2E0
0x8837948d582d553ae6d39ce0f3ba6f582f2deed7
@adria0
adria0 / gist:a45fc7def084440ae3b196091f4356db
Last active June 19, 2017 19:05
format and center align text
package main
import (
"fmt"
"strings"
)
func cutncenter(text string, ncol int) string {
align := func (linewords []string, ncol int) string {
0x2ebc9c42b6b40159625105bddd79c504a4a085bf
0x472F87c14FbbE61c1aB68287e2092ce19238C354
contract StandardTokenWithState {
uint public state;
using SafeMath for uint;
uint256 public totalSupply;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);