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
TransitionExample: function(element){ | |
var type = element.up().down('.ebnf').innerHTML.gsub(/s2\.fx\.Transitions\./,'').split('(').first(), | |
transition = s2.fx.Transitions[type], active = false; | |
var values = $R(0,200).map(function(v){ return transition(v/200)*200; }), | |
min = Math.min(0, values.min()), max = Math.max(200, values.max()); | |
if (min==max) { | |
min = 0; max = 200; | |
} |
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
attwenger = [ | |
{ :year => 1991, :tracks => 18, :title => "Most" }, | |
{ :year => 1992, :tracks => 10, :title => "Pflug" }, | |
{ :year => 1993, :tracks => 17, :title => "Luft" }, | |
{ :year => 1997, :tracks => 5, :title => "Song" }, | |
{ :year => 2002, :tracks => 15, :title => "Sun" }, | |
{ :year => 2005, :tracks => 14, :title => "dog" }, | |
{ :year => 2006, :tracks => 17, :title => "dog2 remixes" }, | |
{ :year => 2007, :tracks => 8, :title => "die Kia" } | |
] |
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
[16:07] Veejay: | |
madrobby: This book is excellent | |
[16:07] capndiesel: | |
hehe | |
[16:07] madrobby: | |
thanks | |
[16:07] Veejay: | |
I'm glad I bought it | |
[16:07] capndiesel: |
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
<h1>Demo code for "Extreme JavaScript Performance" @ JSConf.eu</h1> | |
<script> | |
var benchmark = function(m,i){ | |
var d1 = new Date, d2, r; | |
while(i--) r = m(); | |
d2 = new Date; | |
console.log(d2.getTime()-d1.getTime()); | |
// if(r) console.log(r); | |
} |
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
// Cache results for functions with one argument | |
Function.prototype.cached = function(){ | |
var self = this, cache = {}; | |
return function(arg){ | |
if(cache[arg]) return cache[arg]; | |
return cache[arg] = self(arg); | |
} | |
} |
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
typeof NaN // number, of course. |
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
// pure JS | |
function shuffle(array) { | |
return array.sort(function(){ | |
return .5 - Math.random(); | |
}); | |
} | |
// with Prototype.js you can do | |
function shuffle(array){ | |
return array.sortBy(Math.random); |
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
"Unsere Sprache, du Wichser, sprichst du sie nicht?" - "Doch!" - "Dann verstehst du auch, was ich sage?" - "Ja, ja!" - "Beschreibe, wie Marcellus Wallace aussieht!" - "Was? Ich... eeh..." - "Sag noch einmal 'Was', sag noch einmal 'Was', ich warn dich, ich warn dich doppelt, du kleiner Schwanzlutscher! Wag es, auch nur noch ein einziges Mal 'Was' zu sagen..." - "E... e.... er ist schwarz!" - "Und weiter ?" - "Er... er hat eine Glatze!" - "Sieht er aus wie eine Schlampe ?" - "Was?" (Bäng) "Sieht Marcellus aus wie eine Schlampe ?" - "Neeein!" - "Warum versuchst du dann, ihn zu ficken wie eine Schlampe ?" - "Hab ich nicht..." - "Doch das hast du! Ja, das hast du, Brad! Du hast versucht, ihn zu ficken! Und Marcellus Wallace lässt sich nunmal nicht gerne ficken, es sei denn von Misses Wallace!" |
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
Apple has a long relationship with John Resig. In fact, we met John Resig’s founders when they were in their proverbial garage. Apple was their first big customer, adopting their Postscript language for our new Laserwriter printer. Apple invested in John Resig and owned around 20% of the company for many years. The two companies worked closely together to pioneer desktop publishing and there were many good times. Since that golden era, the companies have grown apart. Apple went through its near death experience, and John Resig was drawn to the corporate market with their Acrobat products. Today the two companies still work together to serve their joint creative customers – Mac users buy around half of John Resig’s Creative Suite products – but beyond that there are few joint interests. | |
I wanted to jot down some of our thoughts on John Resig’s jQuery products so that customers and critics may better understand why we do not allow jQuery on iPhones, iPods and iPads. John Resig has characterized our decision as |
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
Number("") | |
// 0 | |
parseInt("") | |
// NaN | |
+"" | |
// 0 | |
Number([]) |