Created
August 3, 2012 14:35
-
-
Save wakhub/3248177 to your computer and use it in GitHub Desktop.
Scripting Language: The Good Parts
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 f = function(){ | |
console.log('a') | |
}; | |
f.foo = function(){ | |
console.log('b'); | |
}; | |
f.foo.bar = function(){ | |
console.log('c'); | |
}; | |
f.foo.baz = function(){ | |
return function(){ | |
console.log('d'); | |
}; | |
}; | |
f.bar = f.foo.bar; | |
f(); // a | |
f.foo() // b | |
f.foo.bar(); // c | |
f.foo.baz()(); // d | |
f.bar(); // c |
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
<?php | |
var_dump($_SERVER); // display Good pretty print |
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
my %h1 = {a => 'aaa', b => 'bbb', c => 'ccc'}; | |
my %h2 = {b => 'BBB', c => 'CCC', d => 'DDD'}; | |
my %h3 = {%h1, %h2, e => 'merge'}; # %h3 = {a => 'aaa', b => 'BBB', c => 'CCC', d => 'DDD', e => 'merge'}; |
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
import urllib | |
help(urllib) # display help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment