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/sh | |
CUR_DIR=$PWD | |
PID_FILE="$CUR_DIR/node.pid" | |
if [ $1 = "start" ]; then | |
if [ -e $PID_FILE ]; then | |
echo "Node.js is already running." | |
else | |
echo "Starting Node Server" |
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_modules |
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
// geo-location shim | |
// currentely only serves lat/long | |
// depends on jQuery | |
;(function(geolocation){ | |
if (geolocation) return; | |
var cache; |
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
// For Nodejs | |
const crypto = require('crypto'); | |
/** | |
* Get Short Code | |
* | |
* Mini Short Code Generator | |
* | |
* @param {Number} size |
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
// See comments below. | |
// This code sample and justification brought to you by | |
// Isaac Z. Schlueter, aka isaacs | |
// standard style | |
var a = "ape", | |
b = "bat", | |
c = "cat", | |
d = "dog", |
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
<!-- | |
Ant target for autogenerating a changelog based on Git tags | |
Workflow: | |
1. Do all of your checkins for a given version. | |
2. When you're ready to officially create a new version, tag it using git tag, such as "git tag v0.3.0". | |
3. If you don't already have a file named CHANGELOG in the root directory, make one. | |
4. Run "ant changelog.update" |
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
Steps: | |
0. Checkout your git repo from the server (I use /var/www/carbonite) | |
1. Upload both of these files to the same directory on your server | |
2. chmod +x restart_node.sh | |
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log & | |
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/ | |
5. Make a commit to your repo | |
6. Point a browser at http://<your host>:8080/ and you should see the commit |
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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC 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
var Class = Object.create(null, { | |
"new": { | |
"value": function () { | |
var result = Object.create(this, { | |
"class": { | |
"value": this | |
} | |
}); | |
result.initialize.apply(result, arguments); | |
return result; |
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
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
* http://benalman.com/ | |
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
(function($) { | |
var o = $({}); | |
$.subscribe = function() { | |
o.on.apply(o, arguments); |
OlderNewer