Skip to content

Instantly share code, notes, and snippets.

0x13877d729f599decbc8c94c09908d9abc654ab7a
0x09e7390f5b47b2a79004bfd77d094ea1b0d59226
var http = require('http');
var req = http.get({
host: 'http://localhost',
path: '/?id=12'
}, function(response) {
@achiko
achiko / whisper.js
Created February 28, 2017 18:40
whisper sample
console.log('shh clien ....');
var Web3 = require('Web3');
if(typeof web3 !== 'undefined')
web3 = new Web3(web3.currentProvider);
else
web3 = new Web3(new Web3.providers.HttpProvider("http://pokereum.cloudapp.net:8545"));
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>',
@achiko
achiko / postgres_queries_and_commands.sql
Created November 24, 2016 12:28 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- 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%'
Verifying that +achiko is my blockchain ID. https://onename.com/achiko
var Web3 = require('Web3');
if(typeof web3 !== 'undefined')
web3 = new Web3(web3.currentProvider);
else
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8000"));
var lockmyetherContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getTrickleBlock","outputs":[{"name":"TrickleBlock","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"Balance","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_blocknumber","type":"uint256"}],"name":"setExpirationBlock","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getTrickle","outputs":[{"name":"Trickle","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"withdrawFees","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getExpirationBlock","outputs":[{"name":"ExpirationBlock","type":"uint256"}],"type":"function"},{"constant"
var Web3 = require('Web3');
if(typeof web3 !== 'undefined')
web3 = new Web3(web3.currentProvider);
else
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8000"));
var lockmyetherContract = web3.eth.contract([{"constant":true,"inputs":[],"name":"getTrickleBlock","outputs":[{"name":"TrickleBlock","type":"uint256"}],"type":"function"},{"constant":true,"inputs":[],"name":"getBalance","outputs":[{"name":"Balance","type":"uint256"}],"type":"function"},{"constant":false,"inputs":[{"name":"_blocknumber","type":"uint256"}],"name":"setExpirationBlock","outputs":[],"type":"function"},{"constant":false,"inputs":[],"name":"withdraw","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getTrickle","outputs":[{"name":"Trickle","type":"bool"}],"type":"function"},{"constant":false,"inputs":[],"name":"withdrawFees","outputs":[],"type":"function"},{"constant":true,"inputs":[],"name":"getExpirationBlock","outputs":[{"name":"ExpirationBlock","type":"uint256"}],"type":"function"},{"constant"
geth --mine --minerthreads=4 --identity "MyNodeName" --genesis CustomGenesis.json --rpc --rpcport "8000" --rpccorsdomain "*" --datadir "C:\Users\user\AppData\Roaming\Ethereum\testnet" --port "30303" --nodiscover --ipcapi "admin,db,eth,debug,miner,net,shh,txpool,personal,web3" --rpcapi "db,eth,net,web3" --autodag --networkid 1900 --nat "any" --unlock 8dc76d4bd88d9e38b5eca20ef82b0fe2d9bff369