Skip to content

Instantly share code, notes, and snippets.

@xbee
xbee / main.go
Created March 4, 2017 04:21 — forked from walm/main.go
Simple Golang DNS Server
package main
import (
"fmt"
"log"
"strconv"
"github.com/miekg/dns"
)
@xbee
xbee / universal-payment-channels.md
Created January 22, 2017 12:01 — forked from jtremback/universal-payment-channels.md
Universal Payment Channels
@xbee
xbee / blind_oleg.go
Created November 25, 2016 09:18 — forked from kac-/blind_oleg.go
Blind signatures for Bitcoin transactions
package main
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/sha256"
"fmt"
"math/big"
)
@xbee
xbee / pagerank.go
Created October 14, 2016 16:51 — forked from BYVoid/pagerank.go
Calculate pagerank of every vertex in a graph using Go language
package main
import (
"bufio"
"errors"
"fmt"
"io"
"math"
"os"
"strings"
@xbee
xbee / ElasticSearch.sh
Created May 17, 2016 16:30 — forked from ricardo-rossi/ElasticSearch.sh
Installing ElasticSearch on Ubuntu 14.04
#!/bin/bash
### USAGE
###
### ./ElasticSearch.sh 1.7 will install Elasticsearch 1.7
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
@xbee
xbee / Makefile
Created April 4, 2016 10:54 — forked from Arachnid/Makefile
include $(GOROOT)/src/Make.$(GOARCH)
TARG=kademlia
GOFILES=\
nodeid.go\
routingtable.go\
contact.go\
kademlia.go
include $(GOROOT)/src/Make.pkg
@xbee
xbee / ec_lsag_test.py
Created March 18, 2016 11:04 — forked from jesperborgstrup/ec_lsag_test.py
Python implementation of Linkable Ring Signatures over Elliptic curves
# MIT License
#
# Copyright (C) 2014 Jesper Borgstrup
# -------------------------------------------------------------------
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge,
# publish, distribute, sublicense, and/or sell copies of the Software,
# and to permit persons to whom the Software is furnished to do so,
@xbee
xbee / BlockPropagation.md
Created March 6, 2016 13:19 — forked from gavinandresen/BlockPropagation.md
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@xbee
xbee / build.gradle
Last active August 30, 2015 05:46 — forked from MarkMjw/build.gradle
build.gradle base on Android Studio, and modify manifest when building different channel.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}
apply plugin: 'android'
@xbee
xbee / android_replace_in_manifest.gradle
Last active August 30, 2015 04:09 — forked from saadfarooq/android_replace_in_manifest.gradle
Gradle function to replace a placeholder string in AndroidManifest.xml with productFlavor package name
replaceInManifest = {variant, fromString, toString ->
def flavor = variant.productFlavors.get(0)
def buildtype = variant.buildType
def manifestFile = "$buildDir/manifests/${flavor.name}/${buildtype.name}/AndroidManifest.xml"
def updatedContent = new File(manifestFile).getText('UTF-8').replaceAll(fromString, toString)
new File(manifestFile).write(updatedContent, 'UTF-8')
}