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 x(arg1){ | |
function y(arg2){ | |
do stuff | |
} | |
}(z) // <------where does z get subbed in? |
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 board = [0,0,0,0,0,0,0,0,0]; | |
//record move | |
function recordMove(boardIndex, inputSymbol){ | |
board[boardIndex] = inputSymbol; | |
$('#b'+boardIndex).val(inputSymbol); | |
}; | |
//return the board index on click |
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 crypto = require("crypto"); | |
var randArr = new Uint8Array(32) //create a typed array of 32 bytes (256 bits) | |
crypto.randomBytes(32, function(ex, buf) { | |
if (ex) throw ex; | |
randArr.push(buf); | |
console.log('Have %d bytes of random data: %s', buf.length, buf); | |
}); |
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 makeQueue = function() { | |
// Hey! Rewrite in the new style. Your code will wind up looking very similar, | |
// but try not not reference your old code in writing the new style. | |
var instance = {}; | |
instance.storage = {}; | |
instance.index = 0; | |
instance.pointer = 0; |
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 csv = require("fast-csv"); | |
var fs = require("fs"); | |
var totalReceived = 10000; | |
var address = process.argv[2]; | |
var command = process.argv[3]; | |
var fileName = "hello2312"; | |
var currentdate = new Date(); |
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
$(document).ready(function(){ | |
var yearArray = []; | |
$.ajax({ | |
type: 'GET', | |
url: 'http://data.sfgov.org/resource/yitu-d5am.json', | |
dataType: 'json', | |
success: function(json){ | |
for(var i=0; i< json.length; i++){ | |
yearArray.push(json[i].release_year) | |
} |
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
tx = new bitcoin.Transaction() | |
// Add the input (who is paying) of the form [previous transaction hash, index of the output to use] | |
tx.addInput("aa94ab02c182214f090e99a0d57021caffd0f195a81c24602b1028b130b63e31", 0) <---- Where do i get the previous transaction hash?? | |
// Add the output (who to pay to) of the form [payee's address, amount in satoshis] | |
tx.addOutput("1Gokm82v6DmtwKEB8AiVhm82hyFSsEvBDK", 15000) |
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
//helloblock tutorial | |
var privateKey = "cND8kTK2zSJf1bTqaz5nZ2Pdqtv43kQNcwJ1Dp5XWtbRokJNS97N" | |
var ecKey = new bitcoin.ECKey(privateKey) | |
// .ECKey() now either takes an array of randomly generated numbers or a bigDecimal as parameter | |
// from bitcoinjs tutorial |
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 bitcoin = require('bitcoinjs-lib') | |
var helloblock = require('helloblock-js')({ | |
network: 'testnet', | |
debug: true | |
}) | |
//source btc account testnet | |
var sourcePrivateKeyWIF = '91fKWDmVZz7y7SyM5fLUBTuK2eUSYd7wxkwujQ7YLbNxNQU4LiW'; //balance 0.051 BTC | |
var sourceBTCAddress = 'migNkRq9gLmdPhgFfBBUiWaZf17uFE87yq'; |
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 bitcoin = require('bitcoinjs-lib') | |
var helloblock = require('helloblock-js')({ | |
network: 'testnet', | |
debug: true | |
}) | |
//source btc account testnet | |
var sourcePrivateKeyWIF = '91fKWDmVZz7y7SyM5fLUBTuK2eUSYd7wxkwujQ7YLbNxNQU4LiW'; //balance 0.036 BTC | |
var sourceECKey = new bitcoin.ECKey.fromWIF(sourcePrivateKeyWIF); |
OlderNewer