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 hideAddressBar = function() { | |
| _.defer(window.scrollTo, 0, 0); | |
| }; | |
| $(document).ready(hideAddressBar).on('ajaxComplete', hideAddressBar); |
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
| RewriteEngine On | |
| # Set locale cookie if lang query string is set (90 days expiry time) | |
| RewriteCond %{QUERY_STRING} lang=(.*) | |
| RewriteRule .* ?locale=%1 [cookie=locale:%1:.%{HTTP_HOST}:129600:/] | |
| # Append locale to query string if: | |
| # - Query string hasn't already been rewritten | |
| # - Locale cookie is set | |
| # - Request URI isn't a valid file (for assets etc.) |
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 vae_pluck($path, $properties, $json = true) { | |
| $results = array(); | |
| $context = vae($path); | |
| foreach ($context as $entry) { | |
| $result = array(); | |
| foreach ($properties as $key) { | |
| $property = $entry[$key]; |
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
| # Specify where our binaries are (I'm using package.json and npm to handle dependencies) | |
| LESSC = node_modules/.bin/lessc | |
| UGLIFYJS = node_modules/.bin/uglifyjs | |
| # Our LESS input file(s) | |
| LESS = css/base.less | |
| # Our CSS list (replaces .less with .css in the list) | |
| CSS = $(LESS:.less=.css) |
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 Tags = Backbone.Collection.extend({ | |
| suggest: function(suggestion, threshold) { | |
| return this.filter(function(tag) { | |
| return levenshtein(tag.get('name'), suggestion) < (threshold || 3); | |
| }) | |
| } | |
| }); | |
| var tags = new Tags([ | |
| {name: 'Cat'}, |
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 exportJSON() { | |
| var sheets = SpreadsheetApp.getActiveSpreadsheet().getSheets(); | |
| var result = sheets.reduce(function(result, sheet) { | |
| var id = sheet.getName().toLowerCase(); | |
| var data = sheet.getDataRange(); | |
| var values = data.getValues(); | |
| result[id] = values.map(function(row) { | |
| return row.map(function(column) { | |
| return Math.round(column) || column; |
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
| STYLUS = node_modules/.bin/stylus | |
| COFFEE = node_modules/.bin/coffee | |
| UGLIFY = node_modules/.bin/uglifyjs | |
| SPRITER = node_modules/.bin/spriter | |
| RETINA = node_modules/.bin/retina | |
| SCRIPTS = $(shell find src/scripts -name "*.coffee") | |
| STYLES = $(shell find src/styles -name "*.styl") | |
| SPRITES = $(shell find css/images/generated/sprites -name "*.png") |
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
| SPRITES = $(shell find lib/images/generated/sprites -name "*.png") | |
| lib/%.min.css: lib/%.css | |
| $(SPRITER) -t images/generated/sprites/$(shell basename $< .css) -f images/sprites $< | $(CLEANCSS) > $@ | |
| optipng -o7 -quiet $(SPRITES) # No such file | |
| advdef -z -4 -q $(SPRITES) # No such file |
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
Show hidden characters
| { | |
| "jshint_options": | |
| { | |
| "browser": true, // This option defines globals exposed by modern browsers: all the way from good ol' document and navigator to the HTML5 FileReader and other new developments in the browser world. | |
| "devel": true, // This option defines globals that are usually used for logging poor-man's debugging: console, alert, etc. It is usually a good idea to not ship them in production because, for example, console.log breaks in legacy versions of Internet Explorer. | |
| "es5": true, // This option tells JSHint that your code uses ECMAScript 5 specific features such as getters and setters. Note that not all browsers implement these features. | |
| "expr": true, // This option suppresses warnings about the use of expressions where normally you would expect to see assignments or function calls. Most of the time, such code is a typo. However, it is not forbidden by the spec and that's why this warning is optional. | |
| "jquery": true, // This option defines globals expo |
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
| { | |
| "binary_file_patterns": | |
| [ | |
| "*.jpg", | |
| "*.jpeg", | |
| "*.png", | |
| "*.gif", | |
| "*.ttf", | |
| "*.tga", | |
| "*.dds", |