Skip to content

Instantly share code, notes, and snippets.

View makevoid's full-sized avatar

Francesco 'makevoid' Canessa makevoid

View GitHub Profile
@makevoid
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
// purchase a product with a credit card
purchase('productId')
.using( {
cc: "4556934156210213",
valid: "2016-10",
csc: "123"
} )
// purchase a product with paypal
purchase('productId')
@makevoid
makevoid / blockchain_md5_check_distro.EN.md
Last active August 29, 2015 14:25
Idea - blockchainDB application

using cron


tree /etc/cron.d

and on ubuntu, by default there are nthousand cron and youDontKnowWhat they are executing

@makevoid
makevoid / produce_bench.rb
Created June 26, 2015 13:45
produces benchmarks from debug output for our microservices at work
require 'descriptive_statistics'
Dir.glob("before/*") do |path|
lines = File.readlines(path)
lines = lines.map do |line|
m = line.match(/took (\d+\.\d+). Status:/)
m && m[1].to_f
end
@makevoid
makevoid / soup.py
Created June 18, 2015 22:19
bitcoin soup py
from urlparse import urlparse
import json, requests
from bs4 import BeautifulSoup # sudo pip install beautifulsoup4
import codecs
def parse_page(last_note_ts, pos_max):
refresh_cursor = "&refresh_cursor=TWEET-463466102396583936-463468070993137664-BD1UO2FFu9QAAAAAAAAETAAAAAcAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
# https://twitter.com/i/search/timeline?q=#bitcoin since:2014-05-05 until:2014-05-06&src=savs&vertical=default&composed_count=0&include_available_features=1&include_entities=1&include_new_items_bar=true&interval=30000&last_note_ts=1434594375&latent_count=0&refresh_cursor=TWEET-463466102396583936-463468070993137664-BD1UO2FFu9QAAAAAAAAETAAAAAcAAAASAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
@makevoid
makevoid / Rakefile
Created June 16, 2015 03:05
A good default Rakefile to start with - use rake to setup and run your ruby app
# task :default => [:hello]
task :default => [:setup_and_run]
# task :hello do
# puts "hello world"
# end
class Bundle
@makevoid
makevoid / balance_gpio.php
Last active August 29, 2015 14:22
BitSwitch for Raspbery PI - PHP version - Check bitcoin balance example in php and js for the raspberry pi - for @BitcoinKinetics
<?php
include 'config.php';
include 'check_balance.php';
// this file is called by the ajax request
$balance = check_balance($address);
$current_balance = floatval($_GET['currentBalance']);
@makevoid
makevoid / vanitygen_hh_mm_bitcoin_wallets.md
Last active August 29, 2015 14:22
Vanitygen HH:MM Bitcoin Wallets (vanitygen + regexp) - shell api

core script

vanitygen -r '1[1-9]h[1-5][1-9]m'

example result: 14h55m - bitcoin time!

full script

@makevoid
makevoid / bitswitch_intel_edison_counterparty.js
Last active August 29, 2015 14:20
BitSwitch Countertparty version
/*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
makevoid / gist:e23cb266745ece0b1b2c
Created April 26, 2015 20:29
script_openvpn_darioinstall.sh
apt-get update && apt-get upgrade -y && apt-get install -y openvpn easy-rsa && mkdir /etc/openvpn/easy-rsa/ && cp /usr/share/easy-rsa/* /etc/openvpn/easy-rsa/ && cd /etc/openvpn/easy-rsa/ && source vars && ./clean-all && ./build-dh && ./pkitool --initca && ./pkitool --server server && cd keys && openvpn --genkey --secret ta.key && sudo cp server.crt server.key ca.crt dh2048.pem ta.key /etc/openvpn/
@makevoid
makevoid / custom_events.js
Created April 25, 2015 12:22
custom_events.js - example usage (comments in ita)
// var event = new CustomEvent('nome',{
// 'detail': {
// 'flange': 2,
// 'foo': 1
// }
//})
setInterval(function() { // loop
var rand = parseInt(Math.random() * 1000)
var event = new CustomEvent('flanged', {