Skip to content

Instantly share code, notes, and snippets.

View gkucmierz's full-sized avatar
💻

Grzegorz Kućmierz gkucmierz

💻
View GitHub Profile
@gkucmierz
gkucmierz / gist:6754083
Last active December 24, 2015 05:59
making automated multiple BTC withdrawals from mtgox
(function(){
var form = document.querySelector('#withForm');
var DialogsControl = function(w){
w = w || window;
var d = {
alert: w.alert,
confirm: w.confirm,
prompt: w.prompt
@gkucmierz
gkucmierz / gist:8891627
Last active August 29, 2015 13:56
add many transactions in brainwallet #tx
// add many transactions in brainwallet #tx
var add = function(addr, amount) {
document.querySelector('#txAddDest').click();
[].pop.call(document.querySelectorAll('#txDest')).value = addr;
[].pop.call(document.querySelectorAll('#txValue')).value = amount;
};
var addr = prompt().split(/\n/).filter(function(line) {
return line.trim() !== '';
@gkucmierz
gkucmierz / gist:5eaa044d57da4f97ef6f
Last active August 29, 2015 14:02
add aspect to object
_.each(that, function(fn, prop) {
if (typeof fn === 'function') {
that[prop] = function() {
console.log('call: ' + prop);
return fn.apply(that, arguments);
};
}
});
(function() {
@gkucmierz
gkucmierz / ing login
Last active August 29, 2015 14:05
fast insert password in ing shitty login screen
var pass = (prompt()+'').trim();
[].filter.call($('input[type="password"]'), function(inp) {
return !inp.disabled;
}).map(function(inp) {
var n = parseInt(inp.name.match(/[0-9]+/));
return inp.value = pass.charAt(n-1);
});
(function() {
// default comparing functions for specified types
// in config can be defined custom one
var dataTypes = {
'string': function(strA, strB) {
return strA.localeCompare(strB);
},
'number': function(numA, numB) {
return numA - numB;
(function() {
var lastTime = +new Date();
var avgArr = [];
var avg;
setInterval(function() {
var time = +new Date();
var diff = time - lastTime;
lastTime = time;
if (avg) {
if (diff > avg * 2) {
this.AsyncMemory = function () {
var memory;
var tid;
var cleanNextTick = function () {
clearInterval(tid);
tid = setTimeout(function () {
memory = undefined;
});
};
setInterval(function() {
var count = {};
var spans = [].map.call(document.querySelectorAll('#box span'), function (span) {
var prop = span.style.backgroundColor;
if (count[prop]) {
++count[prop].q;
} else {
count[prop] = {q:1, span: span};
}
});
// 0xBa69e7C96E9541863f009E713CaF26d4Ad2241a0
contract Managed {
address public currentManager;
function Managed() {
currentManager = msg.sender;
}
[ { "constant": true, "inputs": [ { "name": "", "type": "uint256" } ], "name": "proposals", "outputs": [ { "name": "recipient", "type": "address", "value": "0x0000000000000000000000000000000000000000" }, { "name": "amount", "type": "uint256", "value": "0" }, { "name": "description", "type": "string", "value": "" }, { "name": "votingDeadline", "type": "uint256", "value": "0" }, { "name": "open", "type": "bool", "value": false }, { "name": "proposalPassed", "type": "bool", "value": false }, { "name": "proposalHash", "type": "bytes32", "value": "0x0000000000000000000000000000000000000000000000000000000000000000" }, { "name": "proposalDeposit", "type": "uint256", "value": "0" }, { "name": "newCurator", "type": "bool", "value": false }, { "name": "yea", "type": "uint256", "value": "0" }, { "name": "nay", "type": "uint256", "value": "0" }, { "name": "creator", "type": "address", "value": "0x0000000000000000000000000000000000000000" } ], "type": "function" }, { "constant": false, "inputs": [ { "name": "_spender", "t