Skip to content

Instantly share code, notes, and snippets.

@wakhub
Created August 3, 2012 14:35
Show Gist options
  • Save wakhub/3248177 to your computer and use it in GitHub Desktop.
Save wakhub/3248177 to your computer and use it in GitHub Desktop.
Scripting Language: The Good Parts
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
<?php
var_dump($_SERVER); // display Good pretty print
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'};
import urllib
help(urllib) # display help
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment