source: [projectcartoon.com](http://www.projectcartoon.com/cartoon/2)
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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/sh | |
if pgrep Dropbox > /dev/null; then | |
osascript -e 'tell application "Dropbox" to quit' | |
fi | |
diskutil unmountDisk /dev/disk2 > /dev/null 2>&1 |
This file contains hidden or 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 express = require('express'); | |
var app = express(); | |
var path = require('path'); | |
app.get('/:site/:file', function(req, res, next){ | |
var filePath = path.join(__dirname + '/sites' , req.params.site, req.params.file); | |
if (fs.existsSync(filePath)){ | |
res.sendfile(filePath); |
This file contains hidden or 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/sh | |
##3.5...10...15...20...25...30...35...40...45...50...55...60...65...70...75...80 | |
## | |
## Debian / Linux / Ubuntu / LSB | |
## Startup script for Express / Node.js application with the forever module | |
## | |
## | |
## A modification of "init.d.lsb.ex" by Nicolas Thouvenin | |
## | |
## |
This file contains hidden or 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
"use strict"; | |
var https = require('https'); | |
var fs = require('fs'); | |
var auth = require('http-auth') | |
var jsDAV = require("jsDav/lib/jsdav"); | |
jsDAV.debugMode = false; | |
var jsDAV_Locks_Backend_FS = require("jsDav/lib/DAV/plugins/locks/fs"); | |
var basic = auth({ | |
authRealm : "Private area.", |
NewerOlder