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
javascript:$('.promoted-tweet').parent().fadeOut(500,function(){$(this).remove()});$('.promoted-account,.promoted-trend').fadeOut(500,function(){$(this).remove()}); |
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
You have @glan to thank for this cool insight into how Apple did their cool 3D view of their new Grand Central Station store. | |
1. In Safari, go to http://www.apple.com/retail/grandcentral/ | |
2. Click 'View More Photos' | |
3. Click bottom/left photo (labeled '360°') | |
4. Open the Web Inspector | |
5. Copy/paste the following in the console and hit Enter: | |
document.querySelector('.ac-cube360-container').style.webkitTransform = 'translateZ(-200px)' |
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 ajax(url, callback) { | |
var xhr; | |
xhr = new XMLHttpRequest(); | |
xhr.open('GET', url, true); | |
xhr.onreadystatechange = function () { | |
if (4 === xhr.readyState && 400 > xhr.status) { | |
callback(xhr); | |
} | |
}; | |
xhr.send(null); |
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 Squares(id) { | |
this.sq = document.getElementById(id) | |
this.$sq = $(this.sq) | |
this.con = sq.getContext('2d') | |
this.sqD = 60 | |
this.styles = [ | |
'#e2e5e3', | |
'#f4f4f4', | |
'#808ab8', | |
'#40455c', |
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 Squares(id) { | |
this.sq = document.getElementById(id) | |
this.$sq = $(this.sq) | |
this.con = sq.getContext('2d') | |
this.sqD = 60 | |
this.styles = [ | |
'#e2e5e3', | |
'#f4f4f4', | |
'#808ab8', | |
'#40455c', |
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 COOLJS = {} | |
COOLJS = (function (window, document, undefined) { | |
var private_var = 'Secret!' | |
function init() { | |
// magic happens | |
} | |
return { | |
init : init | |
} |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Prototypal inheritence</title> | |
<style type="text/css"> | |
form { | |
width: 300px; | |
float: left; |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Prototypal inheritence</title> | |
</head> | |
<body> | |
<form> | |
<div><button onclick="animal.speak();return false;">animal.speak()</button></div> | |
<div><button onclick="dog.speak();return false;">dog.speak()</button></div> |
NewerOlder