Skip to content

Instantly share code, notes, and snippets.

View nilyang's full-sized avatar
💭
I may be slow to respond.

nilyang

💭
I may be slow to respond.
  • Chongqing China
View GitHub Profile
@cdleary
cdleary / rc4.py
Created September 17, 2009 07:22
"""Instructional implementation of Ron's Cipher #4 (AKA RC4).
Follows form of a `Programming Praxis exercise`_.
.. _Programming Praxis exercise:
http://programmingpraxis.com/2009/09/04/rons-cipher-4/
:author: Christopher D. Leary <cdleary@gmail.com>
"""
import textwrap
@yeaha
yeaha / storage_pool_example.php
Last active April 9, 2021 07:45
Lysine存储服务水平/垂直切分机制样例
<?php
// 一个一致性hash实现 http://github.com/pda/flexihash
require '/path/to/flexihash/include/init.php';
require '/path/to/lysine/loader.php';
// user和topic数据垂直切分
// user数据放在mysql数据库
// topic数据放在postgresql数据库
// topic数据水平切分,分区到3台服务器上
$config = array(
# Raw transaction API example work-through
# Send coins to a 2-of-3 multisig, then spend them.
#
# For this example, I'm using these three keypairs (public/private)
# 0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86 / 5JaTXbAUmfPYZFRwrYaALK48fN6sFJp4rHqq2QSXs8ucfpE4yQU
# 04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a986818a7cb624532f062c1d1f8722084861c5c3291ccffef4ec6874 / 5Jb7fCeh1Wtm4yBBg3q3XbT6B525i17kVhy3vMC9AqfR6FH2qGk
# 048d2455d2403e08708fc1f556002f1b6cd83f992d085097f9974ab08a28838f07896fbab08f39495e15fa6fad6edbfb1e754e35fa1c7844c41f322a1863d46213 / 5JFjmGo5Fww9p8gvx48qBYDJNAzR9pmH5S389axMtDyPT8ddqmw
# First: combine the three keys into a multisig address:
./bitcoind createmultisig 2 '["0491bba2510912a5bd37da1fb5b1673010e43d2c6d812c514e91bfa9f2eb129e1c183329db55bd868e209aac2fbc02cb33d98fe74bf23f0c235d6126b1d8334f86","04865c40293a680cb9c020e7b1e106d8c1916d3cef99aa431a56d253e69256dac09ef122b1a9
@JoshuaEstes
JoshuaEstes / bitcoin.conf
Created November 13, 2012 14:21
Install bitcoind on linux and setup server
# bitcoin.conf configuration file. Lines beginning with # are comments.
# Network-related settings:
# Run on the test network instead of the real bitcoin network.
#testnet=0
# Connect via a socks4 proxy
#proxy=127.0.0.1:9050
##############################################################
@dasher
dasher / litecoin.conf
Created December 22, 2012 18:13
example litecoin.conf
# litecoin.conf configuration file. Lines beginning with # are comments.
# Network-related settings:
# Run on the test network instead of the real litecoin network.
#testnet=0
# Connect via a socks4 proxy
#proxy=127.0.0.1:9050
struct Cake {
static Cake Fail;
bool burned();
};
Cake Cake::Fail;
struct Ingredients { bool spoiled(); };
struct BatterAndWhatnot {};
@ajaxray
ajaxray / pecl_http_snippets.php
Last active April 13, 2017 10:59
Using version 2 of PECL HTTP extension (pecl_http)
<?php
// Doc Home - http://devel-m6w6.rhcloud.com/mdref/http
$url = 'http://php.net';
// ## Simple single Get
$req = new \http\Client\Request('GET', $url);
$client = (new \http\Client())
->enqueue($req)
->send();
@tristanwietsma
tristanwietsma / auth.go
Created May 15, 2014 04:15
Golang web server example
package main
import (
"encoding/base64"
"net/http"
"strings"
)
type handler func(w http.ResponseWriter, r *http.Request)
@taufek
taufek / pre-push
Last active January 10, 2023 17:40
PrePush Git Hook with PhpCs and PhpStan
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
exec < /dev/tty