Skip to content

Instantly share code, notes, and snippets.

Sam Armstrong DrSammyD

Block or report user

Report or block DrSammyD

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DrSammyD /
Last active Mar 25, 2020
A double-spend protocol to make 0-confirmation transactions secured by consensus rules.

0-Confirmation Double-Spend Protocol

The problem

Bitcoin-accepting merchants want to receive payment and provide services instantly. However, block construction times can be as much as 10 minutes after the moment a bitcoin transaction is broadcast. In the time after a transaction but before a block’s creation, that transaction can be superseded by another transaction with a larger fee paid to miners.

With the change in the mempool protocol from first-seen-first-included and the rejection of conflicting double spends, to the inclusion of double spends and prioritizing transactions with larger fees attached, 0-conf transactions can no longer be reasonably secure for any sized transaction.

The idea of replace-by-fee was that miners will follow their immediate self-interest, and if miners sporadically act that way, could potentially decrease trust in the system. Now that this approach has been assumed and is the default behavior of miner software, we might consider amending t

DrSammyD / ROA.c
Created Oct 22, 2015
Rivals of Aether gpc program
View ROA.c
/* *
* GPC is a scripting language with C-like syntax.
* To learn more access GPC Language Reference on Help menu.
* *********************************************************** */
define LP = XB360_X;
define LK = XB360_A;
define MP = XB360_Y;
DrSammyD / repeat.js
Created Dec 8, 2014
function which repeats an id a set amount of times and then increments
View repeat.js
var repeat= function(reps){
var repeatOrig=ko.repeat;
var times = reps-1;
var repetion= function(){
return repeatOrig.uid;
DrSammyD / resolveRelink.js
Last active Aug 29, 2015
Track using knockout es5 recursively
View resolveRelink.js
DrSammyD / koSelectizeBinding.js
Last active Jul 6, 2016
Selectize Binding Handler
View koSelectizeBinding.js
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['knockout','jquery','selectize'], factory);
} else {
var selConstructor = (typeof selectize != "undefined")?selectize:$('<select>').selectize().data('selectize').constructor;
})(function (ko,$,selectize) {
DrSammyD / EntityExpressionCopy.cs
Last active Feb 12, 2019
An expression generator to deep copy entities from one type to another, preserving reference loops.
View EntityExpressionCopy.cs
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
namespace EntityExpressionCopy


This is a way of filtering an IQueryable using Dynamic Linq. It composes strings based on Strings retrieved from the database and static values and functions which return strings stored in a dictionary with a key of a columnName for the filter Criterion

Each filter criterion has on it an appColumn which contains the lookup name for the path of the properties on a queryable which it needs to filter on.


DrSammyD / kodash.js
Last active Aug 29, 2015
Knockout dependency detection in chained lodash or underscore calls.
View kodash.js
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
define(['knockout','lodash'], factory);
} else {
})(function (ko, _) {
function isLodash(lodashCalls) {
return lodashCalls && typeof lodashCalls == 'object' && !_.isArray(lodashCalls) &&, '__wrapped__')
module.exports = (grunt) ->
pkg: grunt.file.readJSON('package.json'),
sass: # Task
dist: # Target
files: # Dictionary of files
"Bitcadia.Web/Content/Site.css": "Bitcadia.Web/sass/Site.scss" # 'destination': 'source'
View gist:9082613
define(function () {
return requirejs.config({
paths: {
'text': './text',
'modernizr': './modernizr-2.6.2',
'jquery': './jquery-1.11.0',
'jquery-ui': './jquery-ui-1.10.3',
'jquery-unobtrusive': "./jquery.unobtrusive-ajax",
'jquery-val': "./jquery.validate",
'knockout': './knockout-3.0.0.debug',
You can’t perform that action at this time.