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"> | |
<head> | |
<title>Test</title> | |
<link rel="stylesheet/less" type="text/css" href="app.less"> | |
<script src="http://cdnjs.cloudflare.com/ajax/libs/less.js/1.3.0/less-1.3.0.min.js" type="text/javascript"></script> | |
</head> | |
<body> | |
<header id="appHeader">Header here</header> |
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
// You create your bookmarklet by instantiating | |
// a new Bookmarklet function, then pass in the options like so. | |
// This example checks to see if the var is already defined, and makes | |
// sure not to overwrite it. This could happen if the user clicks on | |
// the bookmarklet more than once. | |
MyBookmarklet = MyBookmarklet || (MyBookmarklet = new Bookmarklet({ | |
// debug: true, // use debug to bust the cache on your resources | |
css: ['/my/style.css'], | |
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
function myFunction(opts) { | |
var defaults = { | |
param1: 'foo', | |
param2: 'bar' | |
}; | |
var options = __extend(defaults, opts); | |
return options; | |
} | |
myFunction({param2: 'baz'}); // { param1: 'foo', param2: 'baz' } |
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> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> | |
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame |
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 Dog = function(name){ | |
var name = name, | |
numberOfBarks = function(volume){ | |
for(var i = 10; volume >= i; i--){ | |
if(volume % 3 === 0){ | |
return volume / 3; | |
} | |
} |
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
// You create your bookmarklet by instantiating | |
// a new Bookmarklet function, then pass in the options like so. | |
// This example checks to see if the var is already defined, and makes | |
// sure not to overwrite it. This could happen if the user clicks on | |
// the bookmarklet more than once. | |
(function(global) { | |
global.Doublestock = new Bookmarklet({ | |
css: [ | |
'css/styles.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
// So let's say you have an async operation that doesn't | |
// use a jQuery-ajax method. In my example, I'll use a call | |
// to the FB API, which just takes a callback function | |
// which gets called with a ```resp``` object. | |
FB.api('/platform', function(resp) { | |
if (resp.data) { | |
success(); | |
} else if (resp.error) { | |
error(); |
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
// Uses Hammer-jquery | https://github.com/EightMedia/hammer.js/blob/master/dist/jquery.hammer.js | |
$.extend(ko.bindingHandlers, { | |
touchEvent: { | |
defaults: {}, | |
init: function(el, valueAccessor, allBindingsAccessor) { | |
var self = ko.bindingHandlers.touchEvent, | |
events = ko.utils.unwrapObservable(valueAccessor()), | |
allOptions = allBindingsAccessor(), | |
opts = allOptions.touchEventOptions ? allOptions.touchEventOptions : {}; |
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($) { | |
var Memcache = function(hash) { | |
var self = this, | |
this.lookupCache = [], | |
this.valueCache = []; | |
$.map(hash, function(val, key) { | |
self.lookupCache.push(key); | |
self.valueCache.push(val); |
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.exports = function(grunt) { | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-contrib-compass'); | |
grunt.loadNpmTasks('grunt-contrib-concat'); | |
grunt.loadNpmTasks('grunt-contrib-copy'); | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks('grunt-contrib-mincss'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); |
OlderNewer