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
Verifying my Blockstack ID is secured with the address 16ZPYPPyVVBAiACAc84BszA9L2TFyhhtX4 https://explorer.blockstack.org/address/16ZPYPPyVVBAiACAc84BszA9L2TFyhhtX4 |
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
// ==UserScript== | |
// @name TakeAlot Saving Calculator | |
// @namespace http://www.takealot.com/ | |
// @version 0.1 | |
// @description Shows % Saving on takealot.com | |
// @match http://www.takealot.com/* | |
// @copyright 2013, Brandon Barker | |
// ==/UserScript== | |
$('.price').each(function (key, value) { |
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 xgminer = require('../lib/xgminer'); | |
var MinerAPI = new xgminer('Miner 1', '192.168.0.111', 4028); | |
MinerAPI.send('summary', '').then(function (res) { | |
console.log(res); | |
}, function (err) { | |
console.log(err); | |
}); |
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
public static class NotNullExtension | |
{ | |
public static TResult IfNotNull<TSource, TResult>(this TSource source, Func<TSource, TResult> accessor, TResult @default = default(TResult)) | |
where TSource : class | |
{ | |
return source != null | |
? accessor(source) | |
: @default; | |
} | |
} |
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 exec = require('child_process').exec, | |
child; | |
child = exec('cat *.js bad_file | wc -l', | |
function (error, stdout, stderr) { | |
console.log('stdout: ' + stdout); | |
console.log('stderr: ' + stderr); | |
if (error !== null) { | |
console.log('exec error: ' + error); | |
} |
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
BitnetClient bc = new BitnetClient("http://127.0.0.1:8332"); | |
bc.Credentials = new NetworkCredential("user", "pass"); | |
var p = bc.GetDifficulty(); | |
Console.WriteLine("Difficulty:" + p.ToString()); | |
var inf = bc.GetInfo(); | |
Console.WriteLine("Balance:" + inf["balance"]); |
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() { | |
// Taken from http://stackoverflow.com/questions/17257237/decode-mixed-ascii-codes-from-a-string-in-javascript | |
function decodeHtmlNumeric( str ) { | |
return str.replace( /&#([0-9]{1,7});/g, function( g, m1 ){ | |
return String.fromCharCode( parseInt( m1, 10 ) ); | |
}).replace( /&#[xX]([0-9a-fA-F]{1,6});/g, function( g, m1 ){ | |
return String.fromCharCode( parseInt( m1, 16 ) ); | |
}); | |
} |
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
io.sockets.on('connection', function (socket) { | |
socket.on('addPlayer', function(player) { | |
players[socket.id] = player; | |
players[socket.id].id = socket.id; | |
console.log("Player " + player.userName + " with id: " + socket.id + " has joined."); | |
for (var key in players) { | |
console.log("Players: " + key + " : " + players[key].userName); | |
} | |
if (Object.size(players) == 2) { | |
io.sockets.emit('ready', true); |
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
// socket.io initialization | |
var server = http.createServer(app).listen(3000); | |
var io = require('socket.io').listen(server); | |
io.set('log level', 1); // reduce logging |
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 movies = [], | |
rounds = [], | |
ready = false; | |
// Scrape IMDb Top 250 chart and store the titles in our movie array | |
var getTop250 = function () { | |
require('node.io').scrape(function() { | |
this.getHtml('http://www.imdb.com/chart/top?ref_=nb_mv_3_chttp', function(err, $) { | |
//Handle any request / parsing errors | |
if (err) this.exit(err); |
NewerOlder