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
| /** | |
| * Read the value of a header in the current document. | |
| * | |
| * This uses a [single] XMLHTTPRequest to do a HEAD of the current document | |
| * and fetch HTTP response header values. Note that the implementation is | |
| * rather stupid in that it spins waiting for the XMLHTTPRequest to complete | |
| * if it hasn't been called yet. | |
| * | |
| * @param name string |
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
| // No need to sub class Array if what you need is just an extended | |
| // array. Example below illustrates the way to extend Array. | |
| function SubArray() { | |
| return Object.defineProperties(Array.prototype.slice.call(arguments), SubArrayDescriptor) | |
| } | |
| SubArray.prototype = Array.prototype | |
| var SubArrayDescriptor = | |
| { constructor: { value: SubArray } | |
| , last: { value: function last() { |
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
| /* | |
| Base 64 implementation in CoffeeScript (Compiled JS) | |
| Converted from Base 64 implementation in JavaScript - Nicholas C. Zakas (2009) | |
| (https://github.com/nzakas/computer-science-in-javascript) | |
| */ | |
| /* | |
| Base64-encodes a string of text. | |
| @param {String} text The text to encode. | |
| @return {String} The base64-encoded string. |
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
| !!! 5 | |
| html(class='no-js') | |
| head | |
| meta(charset='utf-8') | |
| meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
| title | |
| meta(name='description', content='') | |
| meta(name='viewport', content='width=device-width, initial-scale=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
| //quick online/offline check | |
| function hasInternets() { | |
| var s = $.ajax({ | |
| type: "HEAD", | |
| url: window.location.href.split("?")[0] + "?" + Math.random(), | |
| async: false | |
| }).status; | |
| //thx http://www.louisremi.com/2011/04/22/navigator-online-alternative-serverreachable/ | |
| return s >= 200 && s < 300 || s === 304; | |
| }; |
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
| /* | |
| * Date Format 1.2.3 | |
| * (c) 2007-2009 Steven Levithan <stevenlevithan.com> | |
| * MIT license | |
| * | |
| * Includes enhancements by Scott Trenda <scott.trenda.net> | |
| * and Kris Kowal <cixar.com/~kris.kowal/> | |
| * | |
| * Accepts a date, a mask, or a date and a mask. | |
| * Returns a formatted version of the given date. |
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
| import os | |
| import optparse | |
| import signal | |
| import time | |
| import tornado.httpserver | |
| import tornado.httpclient | |
| import tornado.simple_httpclient | |
| import tornado.curl_httpclient | |
| import tornado.ioloop |
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
| /*! | |
| * quantize.js Copyright 2008 Nick Rabinowitz. | |
| * Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php | |
| */ | |
| // fill out a couple protovis dependencies | |
| /*! | |
| * Block below copied from Protovis: http://mbostock.github.com/protovis/ | |
| * Copyright 2010 Stanford Visualization Group | |
| * Licensed under the BSD License: http://www.opensource.org/licenses/bsd-license.php |
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 | |
| function printHelp | |
| { | |
| echo "-h displays this page" | |
| echo "-v displays the version information" | |
| echo "-f compiles and minifies a single file" | |
| echo "-d compiles and minifies all files in a directory" | |
| echo "-i checks dependendancies and installs them if node is installed" | |
| } |
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
| // ==UserScript== | |
| // @name Use Markdown, sometimes, in your HTML. | |
| // @author Paul Irish <http://paulirish.com/> | |
| // @link http://git.io/data-markdown | |
| // @match * | |
| // ==/UserScript== | |
| // If you're not using this as a userscript just delete from this line up. It's cool, homey. |
OlderNewer