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
pwd # ~/tmp | |
( | |
mkdir foo | |
cd foo | |
pwd # ~/tmp/foo | |
) | |
pwd # ~/tmp |
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
Process: Safari [61170] | |
Path: /Applications/WebKit.app/Contents/MacOS/WebKit | |
Identifier: org.webkit.nightly.WebKit | |
Version: ??? (???) | |
Code Type: X86-64 (Native) | |
Parent Process: launchd [151] | |
Date/Time: 2011-06-28 23:34:13.885 +0400 | |
OS Version: Mac OS X 10.6.7 (10J869) | |
Report Version: 6 |
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
Process: Safari [25546] | |
Path: /Applications/Safari.app/Contents/MacOS/Safari | |
Identifier: Safari | |
Version: ??? (???) | |
Code Type: X86-64 (Native) | |
Parent Process: perl5.10.0 [25535] | |
Date/Time: 2011-06-24 20:28:58.876 +0400 | |
OS Version: Mac OS X 10.6.7 (10J869) | |
Report Version: 6 |
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 obj = {}; | |
Object.defineProperty(obj, "x", {value: 42, enumerable: false}); | |
Object.defineProperty(obj.__proto__, "y", {value: 63, enumerable: false}); | |
for (var key in obj) console.log(key) | |
// nothing | |
Object.keys(obj) | |
// [] |
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
rectangle = { | |
width: 10, | |
height: 8 | |
} | |
rectangle.__proto__ = { | |
area: function() { | |
return this.width * this.height | |
} | |
} |
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 snapshot = {}; | |
for (var k in window) { | |
snapshot[k] = window[k] | |
} | |
var a = 1; | |
var diff = {}; | |
for (var k in window) { |
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 myModule = {}; | |
magicNamespace(myModule, function(){ | |
var a = 1; | |
}); | |
myModule.a // 1 |
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 O = {}; | |
// Magic begins | |
var a = 1; | |
// Magic ends | |
a // undefined | |
O.a // 1 | |
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
// Re: http://twitter.com/pepelsbey/status/24410437437 | |
var a = 10; | |
loop = setInterval( fadeout, 1000 ); | |
function fadeout() { | |
console.log(a / 10); | |
if( a > 0 ) { | |
a -= 2; | |
} else { | |
clearInterval( loop ); |