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 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) { | |
// set up some routes | |
switch(req.url) { | |
case '/': | |
console.log("[501] " + req.method + " to " + req.url); | |
res.writeHead(501, "Not implemented", {'Content-Type': 'text/html'}); | |
res.end('<html><head><title>501 - Not implemented</title></head><body><h1>Not implemented!</h1></body></html>'); | |
break; |
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 sys | |
import socket | |
HOST, PORT = "127.0.0.1", 9999 | |
data = " ".join(sys.argv[1:]) | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect((HOST, PORT)) | |
sock.send(data + "\n") |
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
// usage as usual: console.log('inside coolFunc',this,arguments); | |
if (typeof console !== "undefined") { | |
console.logJack = console.log; | |
window.log={} | |
window.log.history = window.log.history || {}; // store logs to a global history for reference | |
console.log=function(){ | |
var timestamp= (new Date); //create a timestamp of the log | |
var millis=timestamp.getTime(); | |
var readableString=timestamp.toUTCString(); |
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
/* | |
* base64.js: An extremely simple implementation of base64 encoding / decoding using node.js Buffers | |
* | |
* (C) 2010, Nodejitsu Inc. | |
* | |
*/ | |
var base64 = exports; | |
base64.encode = function (unencoded) { |
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
#!/usr/bin/env node | |
var cp = require('child_process'); | |
var sys = require ('sys') | |
var fs = require ('fs') | |
var lines = require ('lines') | |
var nextAddress; | |
var i=1, j=1, k=1; | |
nextAddress = function() { | |
++k; |
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 httpProxy = require('http-proxy'); | |
// | |
// Addresses to use in the round robin proxy | |
// | |
var addresses = [ | |
{ | |
host: 'ws1.0.0.0', | |
port: 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
function traverse(obj,func, parent) { | |
for (i in obj){ | |
func.apply(this,[i,obj[i],parent]); | |
if (obj[i] instanceof Object && !(obj[i] instanceof Array)) { | |
traverse(obj[i],func, i); | |
} | |
} | |
} | |
function getPropertyRecursive(obj, property){ |
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 Horofox in #node.js | |
var mongoose = require('mongoose'); | |
var db = mongoose.connect('mongodb://localhost/mydb'); | |
function allowPosts(mongoose) { | |
var Schema = mongoose.Schema; | |
var Posts = new Schema({ | |
name : String, | |
subject: String, | |
comment : String, |
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 fs = require('fs'); | |
var child_process = require('child_process'); | |
var spawn = child_process.spawn; | |
function openEditor(file) { | |
var cp = spawn(process.env.EDITOR, [file], { | |
customFds: [ | |
process.stdin, | |
process.stdout, | |
process.stderr |
OlderNewer