Skip to content

Instantly share code, notes, and snippets.

@tiagolr
tiagolr / satoshi.py
Created November 14, 2019 22:52 — forked from dymurray/satoshi.py
import ecdsa
import ecdsa.ellipticcurve as EC
curve = ecdsa.SECP256k1
x = int('11db93e1dcdb8a016b49840f8c53bc1eb68a382e97b1482ecad7b148a6909a5c', 16)
y = int('b2e0eaddfb84ccf9744464f82e160bfa9b8b64f9d4c03f999b8643f656b412a3', 16)
point = EC.Point(curve.curve, x, y)
pubkey = ecdsa.VerifyingKey.from_public_point(point, curve)
hash1 = 90774958364900180671716888080665726921328827653065727390791155349203800699667
@tiagolr
tiagolr / handlebars.localisation.js
Last active September 15, 2015 02:24 — forked from tracend/handlebars.localisation.js
Handlebars Localisation Helper #cc
// Handlebars Localisation Helper
// Source: https://gist.github.com/tracend/3261055
Handlebars.registerHelper('l10n', function(keyword) {
var lang = (navigator.language) ? navigator.language : navigator.userLanguage;
// pick the right dictionary (if only one available assume it's the right one...)
var locale = window.locale[lang] || window.locale['en-US'] || window.locale || false;
// exit now if there's no data
if( !locale ) return target;
@tiagolr
tiagolr / 1 Main.hx
Last active August 29, 2015 14:25 — forked from nadako/1 Main.hx
Using haxe macros as syntax-tolerant, position-aware json parser
import haxe.macro.Context;
import haxe.macro.Expr;
using haxe.macro.ExprTools;
class Main
{
inline static var QUOTED_FIELD_PREFIX = "@$__hx__";
static function main()
@tiagolr
tiagolr / MacroDefine.hx
Last active August 29, 2015 14:14 — forked from jasononeil/MacroDefine.hx
Macro Define
/**
* Macro Compiler Define example
*
* Shows how to use a compiler configuration macro to set up more "defines" based
* on an existing define.
*
* Jason O'Neil 2013. Use as you please.
*
* haxe -D mydebug --macro "MacroDefine.setDefines()" -x MacroDefine.hx
* -- traces "A" and "B"