This is gmaxwell's 2-of-2 escrow example, adapted to Electrum and to a lesser extent, GFM.
Archey wants to pay Bertha 0.001 BTC for a Twitter Platinum invite, but prevent Bertha from cheating him. Archey selects Iceland to act as
# From: http://www.cyberciti.biz/tips/using-nginx-as-reverse-proxy.html | |
# and: http://www.cyberciti.biz/faq/howto-linux-unix-setup-nginx-ssl-proxy/ | |
# and: http://nginx.org/en/docs/http/websocket.html | |
# Run the following commands as su | |
sudo -s | |
# Use the stable version of nginx | |
nginx=stable | |
# Add nginx repository source | |
add-apt-repository ppa:nginx/$nginx |
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.1.0.deb | |
sudo dpkg -i elasticsearch-1.1.0.deb |
var urls = [ | |
/* Wildcard CORS enabled - Works in PhantomJS 1.9.0 */ | |
'http://updates.html5rocks.com', | |
/* CORS disabled - Fails in PhantomJS 1.9.0 (and every other version) */ | |
'http://www.google.com', | |
/* Hack workaround? */ | |
/* | |
function(httpGet, callback) { | |
phantom.page.settings = (phantom.page.settings || {}); | |
phantom.page.settings.webSecurityEnabled = false; |
This is gmaxwell's 2-of-2 escrow example, adapted to Electrum and to a lesser extent, GFM.
Archey wants to pay Bertha 0.001 BTC for a Twitter Platinum invite, but prevent Bertha from cheating him. Archey selects Iceland to act as
cd ~ | |
sudo apt-get update | |
sudo apt-get install openjdk-7-jre-headless -y | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch and replace wget link below | |
# NEW WAY / EASY WAY | |
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.90.5.deb | |
sudo dpkg -i elasticsearch-0.90.5.deb |
contract tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } | |
contract MyToken { | |
/* Public variables of the token */ | |
string public name; | |
string public symbol; | |
uint8 public decimals; | |
/* This creates an array with all balances */ | |
mapping (address => uint256) public balanceOf; |
contract random { | |
/* Generates a random number from 0 to 100 based on the last block hash */ | |
function randomGen(uint seed) constant returns (uint randomNumber) { | |
return(uint(sha3(block.blockhash(block.number-1), seed ))%100); | |
} | |
/* generates a number from 0 to 2^n based on the last n blocks */ | |
function multiBlockRandomGen(uint seed, uint size) constant returns (uint randomNumber) { | |
uint n = 0; | |
for (uint i = 0; i < size; i++){ |
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
var libxmljs = require("libxmljs"); | |
var xml = [ | |
'<?xml version="1.0" encoding="utf-8"?>', | |
'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">', | |
' <soap:Body>', | |
' <Response xmlns="http://tempuri.org/">', | |
' <Result>', | |
' <client xmlns="">', | |
' <msg>SEARCH OK.</msg>', | |
' <code>0</code>', |
contract owned { | |
address public owner; | |
function owned() { | |
owner = msg.sender; | |
} | |
modifier onlyOwner { | |
if (msg.sender != owner) throw; | |
_ | |
} | |
function transferOwnership(address newOwner) onlyOwner { |