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
'use strict'; | |
module.exports = function (grunt) { | |
var jshintrc = grunt.file.readJSON('.jshintrc'); | |
// super simple shallow copy/merge | |
function merge(o1, o2) { | |
var retVal = {}, i; | |
for (i in o1) { |
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
// V8 initializes memory space for _x and _y | |
// in advance | |
function Klass1() { | |
this._x = null; | |
this._y = null; | |
} | |
var k1 = new Klass1()._x = 'hi'; | |
function Klass2() {} | |
// dynamically defined property converts to a |
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
Element.addMethods({ | |
/** | |
* Browser caveats: IE6 does not add quotes to DOM attributes | |
* when it does not need to. Use `class="#{className} ie"` if | |
* you're going to replace attribute values with spaces. Also, | |
* most browsers load `<img src="#{src}" />` as a 404. | |
*/ | |
templatize: (function(){ | |
var FIND = /(?:#|%23)%7B([^%]+)%7D/g, REPLACE = "#{$1}", | |
ERROR = 'Could not templatize element ', EMPTY = ""; |
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
$,$$,$A,$F,$H,$R,$w,Ajax,Class,Element,Enumberable,Event,Form,Hash,Insertion,PeriodicalExecuter,Position,Prototype,Template,TimedObserver,Try |
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 Geo = navigator.geolocation, // {Object|null} a shortcut to the geolocation static class | |
options = { // {Object} options available to calls for position | |
enableHighAccuracy: false, // {Boolean} Whether or not to use more resources to get a more accurate position | |
maximumAge: 0, // {Number|Infinity} The maximum number of milliseconds since the last check. | |
timeout: null // {Number|null} The maximum number of milliseconds to wait for a fix | |
}, | |
watchId; // {Number} an ID to a watch timeout | |
// handles an error finding the user's position | |
function onError(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
/** | |
* SQLiteDB | |
* | |
* A wrapper class to make sane the HTML 5 client-side storage API. | |
* Makes your code a little bit more self-documenting. | |
*/ | |
var SQLiteDB = (function () { | |
var db = function(args) { | |
if ( SQLiteDB.available ) { this.initialize.apply(this, args); } | |
else { throw new Error("database not available"); } |
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>Simplest jQuery Slideshow</title> | |
<style> | |
body { font-family:Arial, Helvetica, sans-serif; font-size:12px; } | |
.fadein { position:relative; height:332px; width:500px; } | |
.fadein img { position:absolute; left:0; top:0;} | |
.fadein.ready img { -webkit-transition: opacity 1s linear;} | |
</style> |
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> | |
<meta charset="UTF-8"> | |
<title></title> | |
<style> | |
p { font: normal normal 10px/15px sans-serif; margin: 0;} | |
div { display: inline; float: left; height:300px; | |
overflow:auto; margin-right: 20px; width: 300px; } | |
#test { background: #333; color: #FFF; line-height: 300px; |
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
package { | |
import flash.events.Event | |
import flash.events.IEventDispatcher; | |
import flash.external.ExternalInterface; | |
import CustomEvent; | |
public class Dispatcher { | |
private static const FIRE:String = 'Element.fire'; | |
private static const PREFIX:String = 'flash:'; |
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
(1) === 1; // true | |
Number.prototype.isOne = function () { return this === 1; } | |
(1).isOne(); // false! | |
Number.prototype.reallyIsOne = function () { return this - 1 === 0; } | |
(1).reallyIsOne(); // true |
OlderNewer