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
(function(){ | |
var form = document.querySelector('#withForm'); | |
var DialogsControl = function(w){ | |
w = w || window; | |
var d = { | |
alert: w.alert, | |
confirm: w.confirm, | |
prompt: w.prompt |
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
// 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() !== ''; |
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
_.each(that, function(fn, prop) { | |
if (typeof fn === 'function') { | |
that[prop] = function() { | |
console.log('call: ' + prop); | |
return fn.apply(that, arguments); | |
}; | |
} | |
}); | |
(function() { |
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
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); | |
}); |
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
(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; |
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
(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 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
this.AsyncMemory = function () { | |
var memory; | |
var tid; | |
var cleanNextTick = function () { | |
clearInterval(tid); | |
tid = setTimeout(function () { | |
memory = undefined; | |
}); | |
}; |
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
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}; | |
} | |
}); |
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
// 0xBa69e7C96E9541863f009E713CaF26d4Ad2241a0 | |
contract Managed { | |
address public currentManager; | |
function Managed() { | |
currentManager = msg.sender; | |
} |
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
[ { "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 |
OlderNewer