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 ($) { | |
var startPos, curPos, endPos, dragTimer, dragEl, dragOffset; | |
var isTouchable = (function () { return !!('ontouchstart' in window); })(); | |
var events = { | |
touchstart: "mousedown", | |
touchmove: "mousemove", | |
touchend: "mouseup" | |
}; |
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
define(function (require, exports, module) { | |
var lib1 = require('lib1'); | |
var lib2 = require('lib2'); | |
// your code goes here | |
// exports = ...; | |
}); |
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
(def my-apply | |
(fn [function sequence] | |
(eval (cons function sequence)))) | |
;; exercises | |
;; chapter 1 | |
;; 3. add squares | |
(defn add-squares [& args] | |
(apply + (map * args args))) |
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
require.config({ | |
dir: "../../release/js/", | |
optimize: "uglify", | |
paths: { | |
jquery: 'vendor/jquery/jquery-1.9.0', | |
underscore: 'vendor/underscore', | |
backbone: 'vendor/backbone/backbone', | |
text: 'vendor/require/plugins/text', | |
cordova: 'vendor/android/cordova-2.3.0' |
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
// requirejs config in main.js | |
require.config({ | |
paths: { | |
jquery: 'components/jquery/jquery', | |
es5shim: 'components/es5-shim/es5-shim', | |
es5sham: 'components/es5-shim/es5-sham' | |
}, | |
map: { | |
'*': { | |
'flight/component': 'components/flight/lib/component', |
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 (root, factory) { | |
if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else if (typeof define === 'function' && define.amd) { | |
define(factory); | |
} else { | |
root.returnExports = factory(); | |
} | |
}(this, function () { | |
return {}; |
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
'use strict'; | |
define( | |
['./provider'], | |
function (provider) { | |
function AsCollection() { |
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
// backbone.record | |
(function (Backbone) { | |
"use strict"; | |
var api = { | |
initialize: function () {}, | |
removeAll: function () { |
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 splice = Array.prototype.splice; | |
function arraySplice(array1, array2) { | |
return splice.apply(array1, [0, array2.length].concat(array2)); | |
} |
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 toArray(args) { | |
return [].slice.call(args); | |
} | |
function autocurry(fn) { | |
var len = fn.length; | |
var args = []; | |
return function next() { | |
args = args.concat(toArray(arguments)); | |
return (args.length >= len) ? |