I hereby claim:
- I am tsileo on github.
- I am tsileo (https://keybase.io/tsileo) on keybase.
- I have a public key ASAaM39p3ODWGxUJJLRWI907fcqgrbrPCO7kB_s9W-GbEwo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
type Set struct { | |
set map[string]bool | |
} | |
func NewSet() *Set { | |
return &Set{make(map[string]bool)} | |
} | |
func (set *Set) Add(s string) bool { | |
_, found := set.set[s] |
package main | |
import ( | |
"log" | |
"fmt" | |
"bytes" | |
// "strconv" | |
"github.com/jmhodges/levigo" | |
) | |
(function() { | |
var getJSON = function(options, callback) { | |
var xhttp = new XMLHttpRequest(); | |
options.url = options.url || location.href; | |
options.data = options.data || null; | |
callback = callback || function() {}; | |
options.type = options.type || 'json'; | |
var url = options.url; | |
xhttp.open('GET', options.url, true); |
package main | |
import ( | |
"log" | |
"github.com/piotrnar/gocoin/blockdb" | |
"github.com/piotrnar/gocoin/btc" | |
"encoding/hex" | |
) | |
func main() { | |
// Set real Bitcoin network |
package main | |
import ( | |
"log" | |
"fmt" | |
"strconv" | |
"github.com/jmhodges/levigo" | |
"github.com/piotrnar/gocoin/blockdb" | |
"github.com/piotrnar/gocoin/btc" | |
) |
/* | |
JSON serial echo server | |
Parse JSON object over serial, and resend it back. | |
*/ | |
#include <aJSON.h> |
from dateutil.relativedelta import relativedelta | |
from datetime import date | |
def get_last_x_days(x, date_from=date.today()): | |
for i in xrange(x): | |
date_from += relativedelta(days=i) | |
yield date_from |