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
{ | |
"vars": { | |
"@gray-darker": "#000", | |
"@gray-dark": "#1a171b", | |
"@gray": "lighten(@gray-dark, 33.5%)", | |
"@gray-light": "lighten(@gray-dark, 60%)", | |
"@gray-lighter": "lighten(@gray-dark, 93.5%)", | |
"@brand-primary": "#df0b25", | |
"@brand-success": "#5cb85c", | |
"@brand-info": "#5bc0de", |
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 AwesomeObject = function() {}; | |
AwesomeObject.prototype = { | |
doSomeThingAsync: function() { | |
var that = this; | |
// Do that with bind? | |
return asyncThing({ | |
success: function() { that.onSuccess.apply(that, arguments);}, |
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 AwesomeObject = function() { | |
this.init() | |
}; | |
AwesomeObject.prototype = { | |
init: function() { | |
_.bindAll(this, 'onSuccess', 'onError', 'onComplete') | |
// or | |
this.onSuccess = $.proxy(this.onSuccess, this) |
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 () { | |
// support for uploadProgress callback | |
var originalXHR = $.ajaxSettings.xhr; | |
$.ajaxSetup({ | |
xhr: function () { | |
var myXHR = originalXHR(); | |
if (myXHR.hasOwnProperty('upload') && this.hasOwnProperty('uploadProgress')) { |
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
<!doctype html> | |
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="description" content="Scroll demo page"> | |
<meta name="viewport" content="width=device-width"> |
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
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block} | |
audio,canvas,video{display:inline-block;*display:inline;*zoom:1} | |
audio:not([controls]){display:none;height:0} | |
[hidden]{display:none} | |
html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%} | |
html,button,input,select,textarea{font-family:sans-serif} | |
body{margin:0;padding:0} | |
a:focus{outline:thin dotted} | |
a:hover,a:active{outline:0} | |
h1{font-size:2em;margin:0.67em 0} |
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
.ir { border:0; font: 0/0 a; text-shadow: none; color: transparent; background-color: transparent; } | |
.hidden { display: none !important; visibility: hidden; } | |
.visuallyhidden { border: 0; clip: rect(0 0 0 0); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; } | |
.visuallyhidden.focusable:active, | |
.visuallyhidden.focusable:focus { clip: auto; height: auto; margin: 0; overflow: visible; position: static; width: auto; } | |
.invisible { visibility: hidden; } | |
.clearfix:before, .clearfix:after { content: ""; display: table; } | |
.clearfix:after { clear: both; } | |
.clearfix { *zoom: 1; } | |
.pull-left { float:left; } |
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 | |
for filein in `find . -name "*.js" | grep -v \.min\.js` | |
do | |
fileout=${filein/\.js/\.min\.js} | |
echo "Compressing $filein => $fileout" | |
java -jar ~/bin/yuicompressor-2.4.7.jar $filein > $fileout | |
done | |
echo "Finished." |
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
// Bad practice! | |
function detectMobile() { | |
return (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase())); | |
} |
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
<!DOCTYPE html> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style type="text/css"> | |
@media all and (max-width: 640px) { | |
body:after { | |
content: 'small'; |
OlderNewer