This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Conventions for this fork:
- done
-- do global lookups matter? | |
require "os" | |
f = function() return end | |
run = function(n) | |
start = os.clock() | |
for i=1,n do f() end | |
stop = os.clock() | |
return (stop - start) |
tree | |
moreutils | |
most | |
slurm | |
htop | |
mtr | |
multitail | |
iftop | |
ack |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
Conventions for this fork:
Le Web est un système complexe. Certaines erreurs d'implémentation se propagent vite, les développeurs les utilisant. Les implémenteurs de clients Web (navigateurs inclus) doivent hacker pour coller à la réalité du Web tel que pratiqué. Nous verrons ensemble pourquoi les navigateurs implémentent parfois différement de ce que préconise le standard, comment les standards ont évolué pour être plus proches de la réalité et ce que les développeurs peuvent faire pour éviter que les bugs se propagent avec quelques techniques de développement. |
require "redis" | |
local WMAX = 100000 | |
local rc = Redis.connect("unix:///tmp/redis.sock") | |
local rs_mhset = [[ | |
local keys,argv,rcall = KEYS,ARGV,redis.call | |
local n,f = 0,argv[#keys+1] | |
for i,k in ipairs(keys) do n = n + rcall("hset",k,f,argv[i]) end | |
return n |
check-forever : | |
while true ; \ | |
do \ | |
make check || break ; \ | |
make check || break ; \ | |
make check-thread || break ; \ | |
make check-race || break ; \ | |
make check-race || break ; \ | |
make check-compare || break ; \ | |
make check-compare || break ; \ |
function resize() { | |
try { | |
var hauteur=450; | |
var doc=""; | |
if(nav.indexOf('Opera')==-1) { | |
if(document.all) { | |
doc=document.all.mainframe; | |
if(nav.indexOf('Mac')!=-1) { |
[~ 19:35] irb -r'active_support/core_ext' | |
ruby-1.9.2-p136 :001 > "x".as_json | |
NoMethodError: undefined method `as_json' for "x":String | |
from (irb):1 | |
from /Users/pierre/.rvm/rubies/ruby-1.9.2-p136/bin/irb:16:in `<main>' | |
ruby-1.9.2-p136 :002 > "y".to_json | |
=> ""y"" | |
ruby-1.9.2-p136 :003 > "x".as_json | |
=> "x" |
from zipfile import ZipFile,ZIP_DEFLATED,ZIP_STORED | |
from sys import argv | |
with ZipFile(argv[1],"r") as x: | |
for y in x.infolist(): | |
if y.compress_type == ZIP_DEFLATED: | |
print y.filename + " deflated" | |
elif y.compress_type == ZIP_STORED: | |
print y.filename + " stored" | |
else: |
Constantly asking for confirmation where the answer is almost always | |
“yes” conditions the user to press “yes” without thinking about it, a | |
habit that can have very unfortunate consequences. Programs should | |
request confirmation only when there is good reason to suspect that the | |
answer might be “no no no!” A confirmation request that is not a | |
surprise is a strong hint of bad design. Any confirmation prompts at all | |
may be a sign that what your interface really needs is an undo command. | |
-- Eric S. Raymond |