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'); | |
var finishedJobs = []; | |
http.createServer(function (request, response) { | |
if(finishedJobs[request.pathname]) { | |
response.writeHead(200, {'Content-Type': 'text/plain'}); | |
response.end(finishedJobs[request.pathname].toString()); | |
} else { | |
response.writeHead(404, {'Content-Type': 'text/plain'}); | |
response.end("Result not found"); |
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 java.security.SecureRandom; | |
import java.security.cert.CertificateException; | |
import java.security.cert.X509Certificate; | |
import javax.net.ssl.HostnameVerifier; | |
import javax.net.ssl.HttpsURLConnection; | |
import javax.net.ssl.SSLContext; | |
import javax.net.ssl.SSLSession; | |
import javax.net.ssl.TrustManager; | |
import javax.net.ssl.X509TrustManager; |
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 fabric.main as fab | |
from fabric.api import * | |
def getFabCommand(name): | |
parts = name.split(".") | |
p = parts.pop(0) | |
if p not in fab.commands: | |
return None | |
else: | |
command = fab.commands[p] |
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 formidable = require("formidable"); | |
var fs = require("fs"); | |
var form = new formidable.IncomingForm(), | |
files = [], | |
fields = []; | |
form.uploadDir = __dirname+"/uploads"; | |
form | |
.on('field', function(field, value) { |
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
// working NodeSSH can be used by installing via npm this http://github.com/outbounder/NodeSSH/tarball/master | |
var SSHClient = require("NodeSSH"); | |
var Expect = require('node-expect'); | |
var password = "password"; | |
var ssh=new SSHClient("host","root", "rootPassword"); | |
parser = new Expect(); | |
parser.debug = 5; |
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
#!/bin/bash | |
NODE="v0.4.11" | |
NVMDIR=~/.nvm | |
NVM=~/.nvm/nvm.sh | |
echo "installing projectman-repl" | |
hash nvm 2>&- || { | |
echo "couldn't find nvm, sourcing from $NVM" | |
test -e $NVM || { | |
echo "couldn't find $NVM -> installing..." |
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 allCount = items.length; | |
var handleSave = function(err) { | |
if(err) { | |
allCount = 0; // this will prevent sending success: true if invoked again... | |
res.send({ success: false, msg: err}, 400); | |
return; | |
} | |
allCount -= 1; | |
if(allCount == 0) { |
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
#!/bin/bash | |
NODE=$1 | |
NVMDIR=$2 | |
NVM=$NVMDIR/nvm.sh | |
echo "installing node.js $1" | |
hash nvm 2>&- || { | |
echo "couldn't find nvm, checking for $NVM" | |
test -e $NVM || { |
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
// Generated by CoffeeScript 1.3.1 | |
/* | |
Backbone.BindTo | |
Author: Radoslav Stankov | |
Project site: https://github.com/RStankov/backbone-bind-to | |
Licensed under the MIT License. | |
*/ |
OlderNewer