http://blog.commandlinekungfu.com/2009/09/episode-58-thats-pretty-random.html
and
http://lists.freebsd.org/pipermail/freebsd-bugs/2010-January/038142.html
give us:
head -n 64 /dev/urandom | env LC_CTYPE=C tr -dc 0-9 | cut -c1-64
| require 'lingua/en/readability' | |
| class Haiku | |
| def initialize(text) | |
| @report = Lingua::EN::Readability.new(text) | |
| @used_words = Array.new | |
| end | |
| def get_most_used_words(words) | |
| top_words = Array.new | |
| words.sort{|a,b| a[1]<=>b[1]}.slice(words.length/2..words.length).each do |a| |
| # A quick way to tweet from the command line | |
| # As for the name: http://itunes.com/app/oak by @10to1 | |
| # Added 'oak' as source. | |
| function beech(){ | |
| # Twitter != Rocket Science, so security is not that much of an issue | |
| TWITTER_BEECH_USER="username" | |
| TWITTER_BEECH_PASS="password" | |
| if [ $# -ge 1 ]; then |
| require 'rubygems' | |
| require 'hpricot' | |
| require 'open-uri' | |
| # Steve's *cough* new blog | |
| doc = open("http://steve-yegge.blogspot.com/") { |f| Hpricot(f) } | |
| steves_new_blog = Array.new() | |
| (doc/"ul.posts").each { |post|steves_new_blog << post.search("li/a").collect { |a| a.attributes['href']}} | |
| # Steves old blog |
| // javascript:var%20yegge_posts%20=%20new%20Array(%22http://steve-yegge.blogspot.com/2009/05/programmers-view-of-universe-part-3.html%22,%20%22http://steve-yegge.blogspot.com/2009/04/have-you-ever-legalized-marijuana.html%22,%20%22http://steve-yegge.blogspot.com/2009/03/story-time.html%22,%20%22http://steve-yegge.blogspot.com/2008/12/programmers-view-of-universe-part-2.html%22,%20%22http://steve-yegge.blogspot.com/2008/12/fable-ii-arguably-better-than-getting.html%22,%20%22http://steve-yegge.blogspot.com/2008/11/ejacs-javascript-interpreter-for-emacs.html%22,%20%22http://steve-yegge.blogspot.com/2008/10/programmers-view-of-universe-part-1.html%22,%20%22http://steve-yegge.blogspot.com/2008/10/universal-design-pattern.html%22,%20%22http://steve-yegge.blogspot.com/2008/09/bellic-school-of-management-training.html%22,%20%22http://steve-yegge.blogspot.com/2008/09/programmings-dirtiest-little-secret.html%22,%20%22http://steve-yegge.blogspot.com/2008/08/business-requirements-are-bullshit.html%22,%20%22http://steve-y |
| ;; As seen on | |
| ;; http://lucky-dip.net/articles/2009/08/06/restart-passenger-from-emacs-using-rinari/ | |
| ;; Anyway, here is a small snippet of emacs lisp to easily restart the | |
| ;; Passenger server for the project you are currently working on. It | |
| ;; assumes you have Rinari installed. | |
| (defun restart-passenger () | |
| "Restart passenger using the current rinari root" (interactive) | |
| (shell-command (concat "touch " (rinari-root) "tmp/restart.txt")) | |
| (message "Passenger restarted")) |
| Rails | |
| after_create | |
| after_destroy | |
| after_filter | |
| after_save | |
| after_update | |
| after_validation | |
| after_validation_on_create | |
| after_validation_on_update | |
| alias |
| require 'etc' | |
| require 'broach' | |
| Capistrano::Configuration.instance(:must_exist).load do | |
| task "notify campfire" do | |
| source_repo_url = repository | |
| deployer = Etc.getlogin | |
| deploying = `git rev-parse HEAD`[0,7] | |
| begin | |
| deployed = previous_revision[0,7] |
http://blog.commandlinekungfu.com/2009/09/episode-58-thats-pretty-random.html
and
http://lists.freebsd.org/pipermail/freebsd-bugs/2010-January/038142.html
give us:
head -n 64 /dev/urandom | env LC_CTYPE=C tr -dc 0-9 | cut -c1-64
| def connection(connection, didSendBodyData:bytesWritten, totalBytesWritten:totalBytesWritten, totalBytesExpectedToWrite:totalBytesExpectedToWrite) | |
| puts "Written: #{bytesWritten} TotalBytesWritten: #{totalBytesWritten} TotalBytesExpectedToWrite: #{totalBytesExpectedToWrite}" | |
| puts "Double: #{totalBytesWritten / (totalBytesExpectedToWrite/100)}" | |
| progress_bar.setDoubleValue(totalBytesWritten / (totalBytesExpectedToWrite/100)) | |
| end |
| function go() { | |
| if [[ -e ~/development/rails/$1 ]]; then | |
| cd ~/development/rails/$1 | |
| elif [[ -e ~/development/sinatra/$1 ]]; then | |
| cd ~/development/sinatra/$1 | |
| elif [[ -e ~/development/objc/$1 ]]; then | |
| cd ~/development/objc/$1 | |
| elif [[ -e ~/development/php/$1 ]]; then | |
| cd ~/development/php/$1 | |
| elif [[ -e ~/development/ruby/$1 ]]; then |