Skip to content

Instantly share code, notes, and snippets.


John Small JohnSmall

View GitHub Profile
markblundeberg /
Last active Dec 13, 2019
BIP62 and Schnorr: a new era in BCH privacy and smart contracting

Two new features are coming to Bitcoin Cash soon, hopefully in the May 2019 upgrade. I'd like to take the time to explain why I'm so excited about them. In short, we will be able to do:

  • Payment channels hidden as ordinary payments.
  • Atomic swaps hidden as ordinary payments.
  • Lightning-style payment channel networks too, if we want.
  • Secure chains of unconfirmed transactions involving multiple parties (layer 2).

That all may sound incredible, and I'm going to explain in this document how it is so.

--- Mark B. Lundeberg, 2019 Jan 29 bitcoincash:qqy9myvyt7qffgye5a2mn2vn8ry95qm6asy40ptgx2

View fg_find_or_create.rb
module FactoryGirl::Syntax::Methods
def find_or_create(name, attributes = {}, &block)
factory = FactoryGirl.factory_by_name(name)
klass = factory.build_class
factory_attributes = FactoryGirl.attributes_for(name)
attributes = factory_attributes.merge(attributes)
result = klass.find_by(attributes, &block)
tadast /
Last active Nov 19, 2020 — forked from trcarden/gist:3295935
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
elliot /
Created Aug 23, 2011
Luhn Algorithm in CoffeeScript
validateLuhn = (number) ->
odd = true
sum = _(number.split '').reduceRight (total, digit) ->
digit = parseInt(digit)
digit *= 2 if (odd = !odd)
digit -= 9 if digit > 9
total + digit
, 0
mhayes / gist:984326
Created May 21, 2011 — forked from kirs/gist:984320
broken rakefile
View gist:984326
require File.expand_path('../config/application', __FILE__)
require 'rake'
module ::Dpp
class Application
include Rake::DSL
module ::RakeFileUtils
mrrooijen / Capistrano-Deployment-Recipe.rb
Created Jul 29, 2009
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
View Capistrano-Deployment-Recipe.rb
# Guide
# Configure the essential configurations below and do the following:
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
# Initial Deployment:
You can’t perform that action at this time.