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
!!! 5 | |
| <!--[if lt IE 7]> | |
html.no-js.ie6.lt-ie9.lt-ie8.lt-ie7(lang='en') | |
| <![endif]--> | |
| <!--[if IE 7]> | |
html.no-js.ie7.lt-ie9.lt-ie8(lang='en') | |
| <![endif]--> | |
| <!--[if IE 8]> | |
html.no-js.ie8.lt-ie9(lang='en') | |
| <![endif]--> |
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
!!! 5 | |
//if lt IE 7 | |
html(class="no-js ie6 oldie", lang="en") | |
//if IE 7 | |
html(class="no-js ie7 oldie", lang="en") | |
//if IE 8 | |
html(class="no-js ie8 oldie", lang="en") | |
// [if gt IE 8] <!--> | |
html(class="no-js", lang="en") |
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
// http://stackoverflow.com/questions/5422585/preceding-function-in-javascript/5422658#5422658 | |
!function ($) { | |
// body | |
}( window.jQuery ); |
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
/** | |
* Sort array of objects based on another array | |
*/ | |
function mapOrder (array, order, key) { | |
array.sort( function (a, b) { | |
var A = a[key], B = b[key]; | |
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
# Output Directory | |
OUTPUT = ../lib | |
all: css html js | |
css: | |
@echo "stylus => css" | |
@stylus \ | |
-c \ |
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
# | |
# Module Dependencies | |
# | |
{exec} = require 'child_process' | |
fs = require 'fs' | |
path = require 'path' | |
jade = require 'jade' | |
stylus = require 'stylus' | |
nib = require 'nib' |
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
# get file extension from path | |
ext = (path) -> | |
index = path.lastIndexOf('.') | |
extension = path.substr(index).replace('.', '') |
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
# encode html | |
escape = (text) -> | |
replacements = | |
[/&/g, '&'] | |
[/</g, '<'] | |
[/"/g, '"'] | |
[/'/g, '''] | |
for r in replacements | |
text.replace r[0], r[1] |
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
# Debugging Magic! | |
import pprint | |
p = pprint.PrettyPrinter(indent=2) | |
p.pprint(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
# Major US Cities with DMA Codes | |
major_cities = [ | |
{'city': 'Anchorage', 'dma_code': 743, 'latitude': 61.2180556, 'longitude': -149.9002778, 'region': 'AK', 'slug': 'anchorage-ak'}, | |
{'city': 'Fairbanks', 'dma_code': 745, 'latitude': 64.837777799999998, 'longitude': -147.7163889, 'region': 'AK', 'slug': 'fairbanks-ak'}, | |
{'city': 'Juneau', 'dma_code': 747, 'latitude': 58.301944399999996, 'longitude': -134.4197222, 'region': 'AK', 'slug': 'juneau-ak'}, | |
{'city': 'Birmingham', 'dma_code': 630, 'latitude': 33.520660800000002, 'longitude': -86.802490000000006, 'region': 'AL', 'slug': 'birmingham-al'}, | |
{'city': 'Dothan', 'dma_code': 606, 'latitude': 31.223231299999998, 'longitude': -85.3904888, 'region': 'AL', 'slug': 'dothan-al'}, | |
{'city': 'Decatur', 'dma_code': 691, 'latitude': 34.605925300000003, 'longitude': -86.983341699999997, 'region': 'AL', 'slug': 'decatur-al'}, | |
{'city': 'Florence', 'dma_code': 691, 'latitude': 34.799810000000001, 'longitude': -87.677250999999998, 'region': 'AL', 'slug': 'florence-al'}, |
NewerOlder