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 rangify(list){ | |
list = list.map(Number).sort(function(a, b){ return a - b; }); | |
list.push(0); | |
var adder, i, list, number, rangeStart, ranges, _fn, _len; | |
ranges = []; | |
rangeStart = list[0]; | |
adder = 0; | |
_fn = function(number) { | |
if (number !== adder + 1 || i === list.length - 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
HarbourHTTP = function(ip, port){ | |
}; | |
HarbourHTTP.prototype.get = function(){ | |
}; | |
Harbour.registerPlugin(HarbourHTTP, [80]); |
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
Harbour.prototype.parseTargets = function(){ | |
var longestIP, longestHost; | |
var newTargets = []; | |
var oldTargets = this.options.targets.split(','); | |
oldTargets.forEach(function(target){ | |
if(net.isIP(target)){ | |
dns.reverse(target, function(err, domains){ | |
newTargets.push([(domains ? domains[0] : ''), target]); | |
}); |
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 count = 0; | |
setInterval(function(){ | |
$('#counter').text(++count); | |
$('#cost').text('$' + (count * 0.19)); | |
}, 5400);} | |
); |
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
<?php | |
class Collisions { | |
public static function CheckCollision($a, $b){ | |
if( | |
$a->size == 0 || $b->size == 0 || | |
!$a->ShouldCollide($b) || !$b->ShouldCollide($a) || | |
$a->pos-x - $a->size > $b->pos->x + $b->size || | |
$a->pos-x + $a->size < $b->pos->x - $b->size || | |
$a->pos-y - $a->size > $b->pos->y + $b->size || | |
$a->pos-y + $a->size < $b->pos->y- $b->size |
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 x = { | |
foo: 123, | |
hello: 456, | |
what: 789 | |
}; |
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.connect "http://#{document.location.host}" | |
socket.on 'connect', -> | |
$('#loading').text 'Authenticating' | |
$.get '/login_info', (data) -> | |
socket.emit 'login', | |
username: data.username | |
password: data.password | |
socket.on 'disconnect', -> |
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
<img src="http://www.facepunch.com/avatar/15877.png"> | |
<img src="http://www.facepunch.com/avatar/116165.png"> | |
<img src="http://www.facepunch.com/avatar/194495.png"> | |
<img src="http://www.facepunch.com/avatar/112075.png"> | |
<img src="http://www.facepunch.com/avatar/308339.png"> | |
<img src="http://www.facepunch.com/avatar/197527.png"> | |
<img src="http://www.facepunch.com/avatar/72507.png"> | |
<img src="http://www.facepunch.com/avatar/247166.png"> | |
<img src="http://www.facepunch.com/avatar/3855.png"> | |
<img src="http://www.facepunch.com/avatar/439259.png"> |
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
/^(\d+) (.*?) \((.*?)\) (([\d\.]+) ms|\*)(\s!([A-Z])\s|\s)(([\d\.]+) ms|\*)(\s!([A-Z])\s|\s)(([\d\.]+) ms|\*)(\s!([A-Z])| )$/ |
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
Cookie = require('connect').middleware.session.Cookie | |
crypto = require 'crypto' | |
module.exports = (opts) -> (req, res, next) -> | |
cookie = new Cookie | |
sign = (data) -> | |
hmac = crypto.createHmac 'sha1', opts.secret | |
hmac.update data | |
hmac.digest 'hex' | |
decode = -> |
OlderNewer