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 yourFunction = function(id) { | |
var _somePath, | |
_img, | |
conditionA = !! (window.someGlobalVar === 5), // if you need internal ternary conditions (path switching for example) | |
conditionB = !! (window.someGlobalVar === 10), | |
conditionC = !! (window.someGlobalVar === 15); | |
switch (id) { | |
case 'some-id-name-1': | |
// do something |
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
$('body').on('touchstart click', $staticSection, function(e) { | |
var $target = $(e.target); | |
if(!$target.closest($someSection).length) { | |
// do something... ex: $someSection.removeClass('open'); | |
} | |
}); | |
// conditional example | |
$('body').on('touchstart click', $staticSection, function(e) { |
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
Modernizr.load([{ | |
load: [ | |
'//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js' | |
], | |
complete: function() { | |
if (!window.jQuery) { | |
console.log('## CDN Failed - Loading local version of jQuery.'); | |
Modernizr.load('/js/jquery.min.js'); | |
}; | |
} |
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 timer = setTimeout(function() { | |
// code stuffs | |
clearTimeout(timer); | |
}, 500); |
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
## First Run: | |
----------------------- | |
/// Add Project Dependencies | |
Homebrew | |
$ ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)" | |
Success? |
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
application: your-app-cdn | |
version: 1 | |
api_version: 1 | |
runtime: python27 | |
threadsafe: true | |
handlers: | |
# web files | |
- url: /(.*\.css) | |
mime_type: text/css |
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
for(var g in window) { | |
if(window.hasOwnProperty(g)) console.log(g); | |
} | |
// replace window with custom namespace if needed |
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
@font-face { | |
font-family:"FontName"; | |
src:url("fonts/fontname.eot"); | |
src:url("fonts/fontname.eot?#iefix") format("eot"),url("fonts/fontname.woff") format("woff"),url("fonts/fontname.ttf") format("truetype"),url("fonts/fontname.svg#fontname") format("svg"); | |
font-weight: 400; | |
font-style: normal; | |
} | |
@media screen and (-webkit-min-device-pixel-ratio:0) { // android fix | |
@font-face { | |
font-family:"FontName"; |
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
Verifying that +dustintheweb is my openname (Bitcoin username). https://onename.io/dustintheweb |
OlderNewer