This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# AutoXM | |
# written by Daniel Oaks <[email protected]> | |
# released into the public domain | |
# inspired by the public domain autotracker by Ben "GreaseMonkey" Russell | |
import struct, random | |
# XM Module Handling | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# RDoc can use a custom generator but it isn't that well documentated. Here is a | |
# sample custom generator to get you going. | |
# | |
# Ruby comes with an `rdoc` executable but most of us generate our docs via Rake. To | |
# use your custom generator with Rake do something like the following in your Rakefile.. | |
# | |
# require 'rdoc/task' | |
# require 'simple_rdoc' | |
# | |
# RDoc::Task.new('simple_doc') do |i| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* This file is hereby released to public domain */ | |
require_once(__DIR__ . '/../lib/jsonRPCClient_bitcoin.php'); | |
global $CONFIG; | |
$CONFIG = array( | |
'bitcoind_user' => 'change_this', | |
'bitcoind_pass' => 'change_this', | |
'bitcoind_port' => 'change_this', | |
'bitcoind_fee' => 0.0002, // Shoudl be enough for anybody |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# lib/api_blueprint.rb | |
require 'rspec/core/formatters/base_formatter' | |
require 'pry' | |
class ApiBlueprintPrinter | |
def initialize(output) | |
@output = output | |
end | |
def print_meta_info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
APP_NAME="your-app-name-goes-here" | |
APP_PATH=/home/deploy/${APP_NAME} | |
# Production environment | |
export RAILS_ENV="production" | |
# This loads RVM into a shell session. Uncomment if you're using RVM system wide. | |
# [[ -s "/usr/local/lib/rvm" ]] && . "/usr/local/lib/rvm" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Ruby Example of the 'proof of work' explanation | |
# from https://en.bitcoin.it/wiki/Proof_of_work | |
# | |
# note: block data passed to do_work is simplified. | |
# bitcoin blockchain is more complex too. | |
# | |
require 'digest/sha2' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# example of proof-of-work algorithm | |
import hashlib | |
import time | |
max_nonce = 2 ** 32 # 4 billion | |
def proof_of_work(header, difficulty_bits): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
class Merkle | |
attr_accessor :key, :parent, :left, :right | |
def initialize(array, parent = nil) | |
@parent = parent | |
@key = array.join | |
load(array) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cgi' | |
require 'fileutils' | |
desc 'Generate a code review.' | |
# Uses rake code_review[master,qa] by default | |
task :code_review, :left_branch, :right_branch do |cmd, args| | |
left_branch = ( args[:left_branch] || "master" ) | |
right_branch = ( args[:right_branch] || "qa" ) | |
gp = GitParser.new(left_branch, right_branch) | |
gp.fancy_full_diff |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* MerkleTree Implementation | |
* @version 1.0.0 | |
* @author Ronny Amarante <[email protected]> | |
*/ | |
var SHA256 = require("crypto-js/sha256"); | |
function MerkleTree(transactions) { | |
this.transactions = transactions; |