Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
makevoid / stringify_recursive.rb
Last active May 22, 2020 04:19 — forked from edvardm/symbolize_recursive.rb
Recursively symbolize ruby hash keys in a nested structure. Uses refinements instead of monkey patching Hash.
View stringify_recursive.rb
# # usage:
# require_relative 'lib/stringify_helper'
# extend StringifyHelper
# using StringifyHelper
# { test: { foo: "bar" } }.deep_stringify_keys #=> \
# # { "test" => { "foo" => "bar" } }
module StringifyHelper
extend self
View gist:b111d24d54e8735dc5e03c35770659ac
import "AssetLedger.sol";
// TODO describe rules of exchange.
// In the AF market all users benefit from a "last look" facility to prevent
// them falling foul of mechanical arb sniping by those exploiting the way
// the blockchain and smart contract data lags the real markets being tracked.
// The system proceeds through a series of batching steps, which in practice
// might correspond to some number of blocks (for example, each batching step
// corresponds to a block). Orders collected in batching step B_i are initially
// in a "pending" state although visible within the book. Orders then remain
makevoid / juggernaut.rb
Last active August 29, 2015 14:27 — forked from maccman/juggernaut.rb
Sinatra Server Side Event streaming.
View juggernaut.rb
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
makevoid / payments_dreamcode.js
Last active August 29, 2015 14:26 — forked from gr2m/payments_dreamcode.js
Imagine you could purchase items from your store, with pure JavaScript in the browser. How would it look like? Here's what I came up with. Forks & comments much appreciated! #nobackend #dreamcode
View payments_dreamcode.js
// purchase a product with a credit card
.using( {
cc: "4556934156210213",
valid: "2016-10",
csc: "123"
} )
// purchase a product with paypal
makevoid / bitswitch_intel_edison_counterparty.js
Last active August 29, 2015 14:20 — forked from cryptocracy/bitswitch_intel_edison_main.js
BitSwitch Countertparty version
View bitswitch_intel_edison_counterparty.js
/*jslint node:true, vars:true, bitwise:true, unparam:true */
/*jshint unused:false */
/*global */
var mraa = require('mraa'); //require mraa
var request = require('request');
var _ = require('underscore')
var addr2watch = '1LJ4rddYGzT8GqwQioMNw3cYQJdwjM3Drs' // bitcoin address to watch
var assetName = 'PROG'
makevoid / uri.js
Created September 6, 2012 10:53 — forked from jlong/uri.js
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "";
parser.protocol; // => "http:"
parser.hostname; // => ""
parser.port; // => "3000"
parser.pathname; // => "/pathname/"; // => "?search=test"
parser.hash; // => "#hash"; // => ""
makevoid /
Created April 5, 2012 09:19 — forked from erikh/
OSX For Hackers
#!/usr/bin/env sh
echo "Use current directory as default search scope in Finder"
defaults write FXDefaultSearchScope -string "SCcf"
echo "Show Path bar in Finder"
defaults write ShowPathbar -bool true
echo "Disable the Ping sidebar in iTunes"
defaults write disablePingSidebar -bool true
makevoid /
Created January 17, 2012 22:29 JSONP embedded search example

Example of embedded search, and a tribute to Cory Doctorow ;) tnx to @thedod

See it live here.

If you want to embed this (or any other search) in an existing page:

  • Remove first and last line and paste this where you want it in the <body/>.
  • Change query to whatever you want to search (and maybe change limit).
makevoid /
Created August 27, 2011 02:23 — forked from reborg/open_local_html_hotcocoa_webview.rb
Hotcocoa basic WebView hello world (to embed a webpp in a native one basically)


if you don't have macruby and hotcocoa already:

rvm use macruby
gem i hotcocoa

ok then you can run:

hotcocoa webviewbasic

makevoid / install rubycocoa over rvm's
Created November 10, 2010 05:19 — forked from thibaudgg/install rubycocoa over rvm's 1.8.7
install rubycocoa over rvm's 1.8.7
View install rubycocoa over rvm's
# v 1.0.1
~$ ARCHFLAGS='-arch i386 -arch x86_64'
~$ rvm install 1.8.7 --debug --reconfigure -C --enable-shared=yes
~$ wget
~$ tar xzf RubyCocoa-1.0.1.tar.gz && rm RubyCocoa-1.0.1.tar.gz && cd RubyCocoa-1.0.1
~/RubyCocoa-1.0.1$ ruby install.rb config --build-universal=yes
~/RubyCocoa-1.0.1$ ruby install.rb setup
~/RubyCocoa-1.0.1$ sudo ruby install.rb install