Skip to content

Instantly share code, notes, and snippets.

View rubensayshi's full-sized avatar

Ruben de Vries rubensayshi

  • Amsterdam, Netherlands
View GitHub Profile
# Raw transaction API example work-through
# Send coins to a 2-of-3 multisig, then spend them.
#
# For this example, I'm using these three keypairs (public/private)
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw
# First: combine the three keys into a multisig address:
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9
@rubensayshi
rubensayshi / 0.intro
Created September 20, 2012 15:09
FML I'm losing it
Somehow this query is 5seconds the first time I run it and 0.000smtsmall seconds the 2nd time, even if do SELECT SQL_NO_CACHE
I already tried optimizing / repairing the tables, even completely dropped and recreated the database ...
@zhouming
zhouming / MY_Session.php
Created September 8, 2012 05:51
Use redis in Codeigniter Session.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Session extends CI_Session{
private $sess_use_redis = TRUE;
private $redis = '';
public function __construct($params = array()) {
//parent::__construct();
$this->CI =& get_instance();
@ga2arch
ga2arch / beatvdl.py
Created May 26, 2012 15:43
Tool to download mp3 from be-at.tv
import sys
import urllib2
import subprocess
url = sys.argv[1]
f = urllib2.urlopen(url)
content = f.read()
f.close()
tmp = url.split('/')
@rubensayshi
rubensayshi / SequenceFileKeyInputFormat.java
Created April 19, 2012 15:48 — forked from dilip/SequenceFileKeyInputFormat.java
SequenceFileInputFormat and SequenceFileKeyRecordReader for enabling Hive to access data stored in a sequence file's key
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@turicas
turicas / Makefile
Created December 3, 2011 23:22
Create slugs and abbreviate names using Python
test:
clear
nosetests --with-coverage --cover-package name_utils test_name_utils.py
clean:
find -regex '.*\.pyc' -exec rm {} \;
find -regex '.*~' -exec rm {} \;
.PHONY: test clean
@jfsiii
jfsiii / node-flot-example.js
Created November 14, 2011 16:52
Flot 0.7 running on node
require('jsdom').env({
html: '<html><body></body></html>', // URL or markup required
scripts: [
// can't use jQuery 1.7+, atm, b/c of https://github.com/NV/CSSOM/issues/29
'http://code.jquery.com/jquery-1.6.4.min.js',
// Flot 0.7 patched to support node-canvas
'https://raw.github.com/gist/1364155/8d9161159d1e2bbed1a34aad90dd6d7af07a7ccf/jquery.flot-on-node.js'
],
done: function (errors, window)
@jrunning
jrunning / foo.js
Created April 24, 2011 04:16
Getting a class property from an instance of a Backbone.js model (without naming the class explicitly)
var C = Backbone.Model.extend({
foo : function() { return this.constructor.bar; }
}, {
bar : 123
});
var ci = new C;
ci.foo();
// -> 123