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
| Copyright (c) 2011 Jed Schmidt, http://jed.is | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to | |
| permit persons to whom the Software is furnished to do so, subject to | |
| the following conditions: | |
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
| /* | |
| * Example how to preload HTML5 video on the iPad (iOS 3.2+) | |
| * @author Miller Medeiros | |
| * Released under WTFPL | |
| */ | |
| var vid = document.createElement('video'); | |
| vid.src = 'lol_catz.mp4'; | |
| document.getElementById('video-holder').appendChild(vid); |
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 plugin for async dependency load like JSONP and Google Maps | |
| * @author Miller Medeiros | |
| * @version 0.0.1 (2011/03/23) | |
| * Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> | |
| */ | |
| define(function(){ | |
| function injectScript(src){ | |
| var s, t; |
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
| // | |
| // Orthodox Chaining | |
| // | |
| //basic Object that implements chaining | |
| var myObj = { | |
| _val : 'lorem', | |
| val : function(val){ | |
| if(val === void(0)){ | |
| return this._val; |
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
| /*jslint onevar:true, undef:true, newcap:true, regexp:true, bitwise:true, maxerr:50, indent:4, white:false, nomen:false, plusplus:false */ | |
| /*!! | |
| * JS Signals <http://millermedeiros.github.com/js-signals/> | |
| * Released under the MIT license <http://www.opensource.org/licenses/mit-license.php> | |
| * @author Miller Medeiros <http://millermedeiros.com/> | |
| * @version 0.5.3 | |
| * @build 143 (02/21/2011 07:18 PM) | |
| */ | |
| var signals = (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
| /** | |
| * Add items to Array in a sorted order. | |
| * @param {Array} arr | |
| * @param {Number} item | |
| * @author Miller Medeiros | |
| * Released under the WTFPL (http://sam.zoy.org/wtfpl/) | |
| */ | |
| function sortedInsert(arr, item){ | |
| var n = arr.length; | |
| do { n--; } while (item < arr[n]); |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <project name="example-purge-copy" default="" basedir="."> | |
| <!-- properties --> | |
| <!-- make sure you are pointing to the right folder since purgeDeploy can delete undesired files... --> | |
| <property name="deploy.dir" value="../../deploy" /> | |
| <!-- custom tasks --> | |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <project name="sample-require-js" default="" basedir="."> | |
| <!-- properties --> | |
| <property name="r.js" value="_build/rjs/r.js" /> | |
| <property name="closure.jar" value="_build/closure/compiler.jar" /> | |
| <property name="rhino.jar" value="_build/rhino/js.jar" /> | |
| <property name="js.build" value="_build/js.build.js" /> | |
| <property name="css.build" value="_build/css.build.js" /> |
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
| /* | |
| * Example #1 : usage example | |
| * - Image paths are relative to the HTML file. | |
| * - Support absolute paths as well. | |
| * - Appending `!bust` to the end of the file name will avoid caching the image. | |
| */ | |
| require(['image!lol_cat.gif', 'image!http://tinyurl.com/4ge98jz', 'image!dynamic_image.jpg!bust'], function(cat, awesome, dynamic){ | |
| //add loaded images to the document! | |
| document.body.appendChild(awesome); | |
| document.body.appendChild(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
| /** | |
| * Helper methods for WebKit CSS Animations and Transitions | |
| * @author Miller Medeiros | |
| * @version 0.0.7 (2011/02/06) | |
| * @namespace | |
| */ | |
| var webkitCSSAnim = { | |
| DEFAULT_DURATION : '500ms', | |