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
| /* | |
| * HTML: | |
| * <div id="modal-overlay"></div> | |
| * <div id="modal"><a id="modal-close">x</a><div id="modal-content"></div></div> | |
| * | |
| * CSS: | |
| * #modal-overlay { | |
| * display: none; | |
| * position: fixed; | |
| * top: 0; |
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
| <?php | |
| // HTACCESS: | |
| // ---------------------------------- | |
| // Options +FollowSymLinks | |
| // RewriteEngine On | |
| // RewriteCond %{REQUEST_FILENAME} !-f | |
| // RewriteCond %{REQUEST_FILENAME} !-d | |
| // RewriteRule ^ api.php [QSA,L] |
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
| // See example at http://jsfiddle.net/fluidbyte/AhBKq/ | |
| var broadcast = { | |
| speak: function (name, message) { | |
| $(document).trigger(name, message); | |
| }, | |
| listen: function (name, callback) { | |
| $(document).bind(name, function (e, message) { |
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
| /** | |
| * Simple localStorage with Cookie Fallback | |
| * v.1.0.0 | |
| * | |
| * USAGE: | |
| * ---------------------------------------- | |
| * Set New / Modify: | |
| * store('my_key', 'some_value'); | |
| * | |
| * Retrieve: |
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
| 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 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 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 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
| /** | |
| * Library-Independent AJAX Function | |
| * | |
| * Usage: | |
| * -------------------------------- | |
| * | |
| * ajax(url, { ...properties... }); | |
| * -or- | |
| * ajax({ ...properties... }); | |
| * |
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
| /** | |
| * | |
| * 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 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
| /** | |
| * | |
| * 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 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/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 |