This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"encoding/base64" | |
"net/http" | |
"strings" | |
) | |
type handler func(w http.ResponseWriter, r *http.Request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Cake { | |
static Cake Fail; | |
bool burned(); | |
}; | |
Cake Cake::Fail; | |
struct Ingredients { bool spoiled(); }; | |
struct BatterAndWhatnot {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
############################################################## |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""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 |