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: | |
... grunt config ... | |
templates: { | |
main: { | |
header: '\n<!-- {{tplbasename}} -->\n<div data-tpl="{{tplbasename}}">\n', | |
footer: '\n</div>\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
1. Run the following commands: | |
a2enmod proxy | |
a2enmod proxy_http | |
2. Setup a VirtualHost in /etc/apache2/sites-available/ | |
<VirtualHost *:80> | |
ServerName something.mydomain.com | |
ProxyPass / http://something.mydomain.com:9999 |
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 | |
# Script to easily create VHosts | |
echo "Enter URL [ENTER]:" | |
read url | |
echo "Enter folder path [ENTER]:" | |
read path |
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 | |
# Script to easily (re)create folder and pull repo for testing | |
echo "Enter folder name [ENTER]:" | |
read folder | |
echo "Enter git repo (space) branch [ENTER]:" | |
read repo |
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
/** | |
* | |
* Dev NodeJS Script for testing basic REST calls - GET, POST, PUT, DELETE | |
* | |
* Place in root of site, create data.json in root with following format: | |
* [ | |
* { | |
* id: "1", | |
* ...additional params... | |
* }, |
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
/** | |
* | |
* Simple Plain-English Key Combo Listener | |
* | |
* Usage / Example: | |
* ====================================== | |
* var konami = new combo({ | |
* code: 'up up down down left right left right b a', | |
* timeout: 5000, | |
* callback: function(){ |
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
/** | |
* Library-Independent AJAX Function | |
* | |
* Usage: | |
* -------------------------------- | |
* | |
* ajax(url, { ...properties... }); | |
* -or- | |
* ajax({ ...properties... }); | |
* |
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'), | |
fs = require('fs'), | |
path = require('path'), | |
port = 8080, | |
default_file = 'index.html'; | |
http.createServer(function (request, response) { | |
// Params | |
var contentType, |
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 each(obj,callback){ | |
// Ensure callback is a function | |
if (!callback || typeof(callback) !== "function") { | |
throw new Error("Callback is not a function."); | |
return false; | |
} | |
// If obj is an array | |
if(obj.constructor === Array){ | |
for (var i=0, z=obj.length; i<z; i++){ |
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
/** | |
* Simple localStorage with Cookie Fallback | |
* v.1.0.0 | |
* | |
* USAGE: | |
* ---------------------------------------- | |
* Set New / Modify: | |
* store('my_key', 'some_value'); | |
* | |
* Retrieve: |