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 http = require('http'); | |
http.createServer(function (req, res) { | |
var timeout = setTimeout(function() { | |
clearTimeout(main); | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
res.end('Quit!'); | |
}, 2000); | |
var main = setTimeout(function() { | |
clearTimeout(timeout); |
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 MailParser = require("mailparser").MailParser; | |
exports.hook_queue = function (callback, connection) { | |
// Parse the mail first... | |
var mp = new MailParser({fix_smtp_escapes: 0}); | |
var headers; | |
var body; | |
var t = this; | |
mp.on('header', function (h) { |
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
(Yeah, Ah-Ah-Ah-Ah-Ah-Ark) | |
Oo-ooh-ooh, hoo yeah, yeah | |
Yeah, yeah | |
Yeah-ah-ah | |
Yeah-ah-ah | |
Yeah-ah-ah | |
Yeah-ah-ah | |
Yeah, yeah, yeah | |
7am, waking up in the morning |
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
const FRAME_WIDTH = 410; | |
const FRAME_HEIGHT = 280; | |
const MAX_COLUMNS = 10; | |
var newDocumentName = prompt("Name of new document?", "New Sprite Sheet"); | |
var images = getFolder(), | |
background = getBackground(), | |
columns = Math.min(MAX_COLUMNS, images.length), |
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
from django.template import Library, Node, TemplateSyntaxError, Variable, VariableDoesNotExist | |
from django.core.cache import cache | |
from django.utils.hashcompat import md5_constructor | |
import urllib2 | |
register = Library() | |
class GistNode(Node): | |
def __init__(self, gist_id, filename=None, *args): |
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
$('#sprite_once').sprite({ | |
speed: 50, | |
frames: 72, | |
columns: 9, | |
mode: 'once', | |
onStep: function(e) | |
{ | |
$(this).nextAll('.status').text(e.step); | |
}, | |
onComplete: 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
$fh = fopen($box->download_url('862161200'), 'r'); // Open box.net file | |
$tmp = tempnam(sys_get_temp_dir(), 'DOC'); // create tmp file | |
print_r($tmp); | |
echo '<br />'; | |
$tfh = fopen($tmp, 'w'); | |
fwrite($tfh, fread($fh, 13421772)); // write bytes from box.net file to tmp file | |
fseek($tfh, 0); | |
// Then load tmp file into ZipArchive->open() and use this function: | |
http://www.botskool.com/geeks/how-extract-text-docx-or-odt-files-using-php |
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
import xbmc | |
import xbmcgui | |
METHODS = ("Director", "Genre", "TagLine", "Plot", "PictureURL", "Title", "OriginalTitle", "Votes", "Cast", "File", "Path", "IMDBNumber", "Year", "Premiered", "FirstAired", "Rating", "PlayCount", "LastPlayed") | |
class OpenGraphPlayer(xbmc.Player) : | |
def __init__ (self): | |
xbmc.Player.__init__(self) | |
def onPlayBackStarted(self): |
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
====== PING (inline) ====== | |
10000 requests completed in 0.28 seconds | |
50 parallel clients | |
3 bytes payload | |
keep alive: 1 | |
99.57% <= 1 milliseconds | |
100.00% <= 1 milliseconds | |
35211.27 requests per second |
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 is how we have to do it now. | |
*/ | |
var buffers = []; | |
var nread = 0; | |
something.on('data', function(chunk) { | |
buffers.push(chunk); | |
nread += chunk.length; | |
}); |