Skip to content

Instantly share code, notes, and snippets.

View Maciek416's full-sized avatar

Maciej Adwent Maciek416

View GitHub Profile
element.addEventListener( 'webkitTransitionEnd', function(){ console.log("yay"); }, false );
var f = function(){
console.log(this.x);
};
var o1 = {
x: 7,
a: f
};
o1.a();
_.bind(generatePage, this);
git diff stash@{0} | mate
for(var i = 0; i < 10; i++){
if(i % 2 == 0) {
console.log("even");
} else {
console.log("odd");
}
}
for(var i = 0; i < 10; i++)
(i % 2 == 0)
? console.log("even")
: console.log("odd")
var someElementRef;
// ... time passes and someElementRef gets filled. Now we can do:
$(someElementRef).find(".some .fun .selector");
// Or, even better, cache the jQuery result before doing the above
// Only run this once so we don't keep re-jQueryifying
someElementRef = $("#bob");
// Hammer this object with .find() as often as desired
<p>
<span>
<span>The <a>quick</a> brown</span>
<span>fox. jump. ed </span>
over the lazy dogs.
</span>
</p>
["","","",""]
<p>
<span>
<span>The <a>quick</a> brown</span>
<span>fox. jump. ed </span>
over the lazy dogs.
</span>
</p>
["","","",""]
<p>
<span>
<span>The <a>quick</a> brown</span>
<span>fox. jump. ed </span>
over the lazy dogs.
</span>
</p>
["","","",""]