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 mysql = require("mysql"); | |
var async = require("async"); | |
var db; | |
async.waterfall([ | |
//connect | |
function(callback) | |
{ | |
db = new mysql.Client(); |
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 Module manages all /minified/* requests. It controls the | |
* minification && compression of Javascript and CSS. | |
*/ | |
/* | |
* 2011 Peter 'Pita' Martischka | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. |
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
/* | |
$ node errortest.js | |
/home/pita/Desktop/errortest.js:46 | |
throw err; | |
^ | |
Async Stacktrace: | |
at /home/pita/Desktop/errortest.js:56:9 | |
at /home/pita/Desktop/errortest.js:66:8 | |
at /home/pita/Desktop/errortest.js:77:8 |
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
wget -c -r -np -e robots=off -A mp4,sha1 http://mirror.fem-net.de/CCC/28C3/mp4-h264-HQ/ && sha1sum -c mirror.fem-net.de/CCC/28C3/mp4-h264-HQ*.sha1 |
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
#include <stdio.h> | |
#include <string.h> | |
int v8hash(char *str, int length){ | |
int hash = 0, i=0; | |
for(;i<length;i++){ | |
hash += str[i]; | |
hash += (hash << 10); | |
hash ^= (hash >> 6); |
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
//File uploads | |
app.post('/upload', function(req, res) | |
{ | |
new formidable.IncomingForm().parse(req, function(err, fields, files) | |
{ | |
//handle errors | |
if(err){ | |
res.send("Error"); | |
fileLogger.error(err); | |
return; |
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 net = require("net"); | |
require("log4js"); | |
var trafficLeft = 0; | |
var monthlyTraffic = 13 * 1024 * 1024 * 1024; //13GB | |
var targetHost = "www.youtube.com"; | |
var connectionCounter = 0; | |
function forwardOnPort(port){ | |
var server = net.createServer(function(inCon){ |
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 request = require("request"); | |
var parser = require("xml2json"); | |
var db = require("dirty")("db.db"); | |
var nodemailer = require("nodemailer"); | |
var transport = nodemailer.createTransport("Sendmail"); | |
db.on('load', function() { | |
request('http://www.gumtree.com/rssfeed/single-room-flatshare/shoreditch', function (err, response, body) { | |
if(err){ | |
throw 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
Show hidden characters
{ | |
// turn on to ENABLE warnings | |
"bitwise": false | |
, "curly": true | |
, "eqeqeq": false | |
, "forin": false | |
, "immed": true | |
, "latedef": false | |
, "newcap": true | |
, "noarg": true |