Copyright 2007 "carlanderson" As retrieved from on July 16, 2012
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
# $ python -i withtest.py | |
# initializing <__main__.cex instance at 0x10f219e18> () {} | |
# entering <__main__.cex instance at 0x10f219e18> () {} | |
# with <__main__.cex instance at 0x10f219e18> | |
# exiting <__main__.cex instance at 0x10f219e18> (None, None, None) {} | |
class cex: | |
def __enter__(slf, *a, **k): | |
print 'entering', slf, a, k | |
return slf | |
def __exit__(slf, *a, **k): |
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
function hoist (source, target, property, prfx, sufx) { | |
for (var p in source[property]) { | |
target[(prfx||'') + p + (sufx||'')] = source[property][p]; | |
} | |
} | |
var source = { | |
loader: { | |
fire: function () { alert('fire!') } | |
} |
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
$ diff <(echo "Hello") <(echo "h3ll0") | |
1c1 | |
< Hello | |
--- | |
> h3ll0 |
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
sed ':a; $!N; s/[\r\n]//g; s/\/\*.*\*\///g; ta; s/ *\([{!:;,}]\) */\1/g; s/}[^{]*{}/}/g;' |
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
javascript:var v_='1.0.0', p={home:'', work:''}, arr,addr='',newURL='',i=0,t='', sub=function(s){return p[s]||s;}, URLEncode=function (a){var b='0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.!~*%25()', c='0123456789ABCDEF', d='',e='',f=''; for(i=0;i<a.length;i++){ e=a.charAt(i); if(e==' ') d+='+'; else if(b.indexOf(e)!=-1) d+=e; else{ f=e.charCodeAt(0); if(f>255){ alert('Character %25'+e+'%25 will be encoded as a space will be used.'); d+='+'; } else{ d+='%'+c.charAt((f>>4)&0xF)+c.charAt(f&0xF)}}} return d}; if(typeof String.prototype.trim == 'undefined'){ String.prototype.trim = function(){ return this.replace(/^\s\s*/,'').replace(/\s\s*$/,'')}} if(typeof document.getSelection()=='string'&&(addr=document.getSelection()).length>0&&confirm('XGMaps detected a possible address selection. Would you like XGMaps to use this selection?')){} else{ addr=unescape('%s'); if(addr=='%25s'){ addr='home'} if(addr.indexOf('--')!=-1){ arr=addr.split('--'); addr='from:'+sub(arr[0].trim()); for(i=1;i<arr.leng |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
Array.prototype.until = function ( test, fn) { | |
var l = this.length, | |
i = l, | |
_; | |
for ( ; i && !test( _ = this[l-i] ) ; --i ) { | |
fn( _ ); | |
} | |
}; |
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
Hypermedia designs scale better, are more easily changed, and promote decoupling | |
and encapsulation; with all the benefits those things bring. On the downside, | |
it is not necessarily the most latency-tolerant design, and caches can get stale | |
if you're not careful. It may not be as efficient on an individual request level | |
as other designs. |
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
For those folks not already hanging out in #documentcloud... here's the log of this afternoon's Ember/Backbone politics discussion. | |
12:21 PM <wycats> jashkenas: hey | |
12:21 PM <wycats> jashkenas: I'm sorry | |
12:21 PM <wycats> how would you like me to describe backbone? | |
12:21 PM <wycats> let's work this out for once and for all :) | |
12:21 PM <wycats> I'm definitely not intentionally saying incorrect things about backbone | |
12:22 PM • knowtheory gets out popcorn | |
12:24 PM <jashkenas> don't worry about it too much -- I'm just not terribly pleased with backbone being continued to be used as the strawman... | |
12:24 PM <wycats> jashkenas: I am worried about it a lot |