Skip to content

Instantly share code, notes, and snippets.

@gnarf
gnarf / ..git-pr.md
Last active April 12, 2024 22:00
git pr - Global .gitconfig aliases for Pull Request Managment

Install

Either copy the aliases from the .gitconfig or run the commands in add-pr-alias.sh

Usage

Easily checkout local copies of pull requests from remotes:

  • git pr 4 - creates local branch pr/4 from the github upstream(if it exists) or origin remote and checks it out
  • git pr 4 someremote - creates local branch pr/4 from someremote remote and checks it out
@kac-
kac- / blind_oleg.go
Last active April 10, 2024 09:59
Blind signatures for Bitcoin transactions
package main
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/sha256"
"fmt"
"math/big"
)
@jointhepartypooper
jointhepartypooper / gist:5fa889e9e6e7fb6b6d5b
Last active December 1, 2015 17:26
hookGetFindstakeData
var http = require('http');
function checkTxPresent(txId, txIndex, cb) {
var keytx = 'to' + txId + '_' + txIndex;
var str = '';
var fileurl = "http://peercoinfindstakedata.divshot.io/json/" + keytx + '.json';
var handleRes = function (res) {
var isOK = (res.statusCode == 200);
res.on('data', function (chunk) {
@davecgh
davecgh / example_txscript_signaturescript.go
Last active September 20, 2018 19:45
Example of signing a transaction using txscript.SignatureScript
package main
import (
"encoding/hex"
"fmt"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
@johnyzed
johnyzed / alter_global_param.groovy
Created June 9, 2015 05:14
alter jenkins global parameter
import jenkins.*
import jenkins.model.*
import hudson.*
import hudson.model.*
nodes = Jenkins.getInstance().getGlobalNodeProperties()
@iammerrick
iammerrick / PinchZoomPan.js
Last active April 22, 2024 02:54
React Pinch + Zoom + Pan
import React from 'react';
const MIN_SCALE = 1;
const MAX_SCALE = 4;
const SETTLE_RANGE = 0.001;
const ADDITIONAL_LIMIT = 0.2;
const DOUBLE_TAP_THRESHOLD = 300;
const ANIMATION_SPEED = 0.04;
const RESET_ANIMATION_SPEED = 0.08;
const INITIAL_X = 0;
@QuentinFonteneau
QuentinFonteneau / flush-image-style.php
Created January 19, 2018 13:26
Flush all image styles in Drupal 8
$imageStyle = \Drupal::entityTypeManager()->getStorage('image_style');
$styles = $imageStyle->loadMultiple();
foreach ($styles as $style) {
$imageStyle->load($style->get('name'))->flush();
}

Scriptless Script for DLC

Scriptless Script

Assumptions

pk_script
<witness version 0x0X> <public key / EC point : P >

v3.0.0 v3.1.0 v3.1.1 master
v3.0.0 Y
v3.1.0 X
v3.1.1 X
master X X X X
@chris-belcher
chris-belcher / coinswap-design.md
Last active May 27, 2024 05:16
Design for a CoinSwap Implementation for Massively Improving Bitcoin Privacy and Fungibility

Design for a CoinSwap Implementation for Massively Improving Bitcoin Privacy and Fungibility

25/5/2020

Abstract

Imagine a future where a user Alice has bitcoins and wants to send them with maximal privacy, so she creates a special kind of transaction. For anyone looking at the blockchain her transaction appears completely normal with her coins seemingly going from address A to address B. But in reality her coins end up in address Z which is entirely unconnected to either A or B.

Now imagine another user, Carol, who isn't too bothered by privacy and sends her bitcoin using a regular wallet which exists today. But because Carol's transaction looks exactly the same as Alice's, anybody analyzing the blockchain must now deal with the possibility that Carol's transaction actually sent her coins to a totally unconnected address. So Carol's privacy is improved even though she didn't change her behaviour, and perhaps had never even heard of this software.