Skip to content

Instantly share code, notes, and snippets.

View sebmck's full-sized avatar

Sebastian sebmck

  • 02:00 (UTC -05:00)
View GitHub Profile
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) {
HarbourHTTP = function(ip, port){
};
HarbourHTTP.prototype.get = function(){
};
Harbour.registerPlugin(HarbourHTTP, [80]);
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]);
});
$(document).ready(function(){
var count = 0;
setInterval(function(){
$('#counter').text(++count);
$('#cost').text('$' + (count * 0.19));
}, 5400);}
);
<?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
var x = {
foo: 123,
hello: 456,
what: 789
};
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', ->
<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">
/^(\d+) (.*?) \((.*?)\) (([\d\.]+) ms|\*)(\s!([A-Z])\s|\s)(([\d\.]+) ms|\*)(\s!([A-Z])\s|\s)(([\d\.]+) ms|\*)(\s!([A-Z])| )$/
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 = ->