Skip to content

Instantly share code, notes, and snippets.

View tsileo's full-sized avatar

Thomas Sileo tsileo

View GitHub Profile

Keybase proof

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:

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"
)
@tsileo
tsileo / json_serial_echo_server.ino
Created July 11, 2013 19:56
JSON serial echo serve, parse JSON object over serial, and resend it back.
/*
JSON serial echo server
Parse JSON object over serial, and resend it back.
*/
#include <aJSON.h>
@tsileo
tsileo / gfs.ipynb
Last active December 17, 2015 04:49
Bakthat debug GFS
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tsileo
tsileo / notebook.ipynb
Created May 8, 2013 08:13
GFS debug for bakthat
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tsileo
tsileo / last_x_days.py
Created April 11, 2013 16:04
Return the last x days from a datetime.date object
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