cheat sheets.

$ cheat scili
--- scili version 29	Fri Sep 23 05:40:43 -0700 2011
+++ scili version 39	Wed Mar 07 19:40:55 -0800 2012
@@ -1,140 +1,188 @@
 You've stumbled upon Matt Scilipoti's "personal" cheat sheet.
 
 Debug
 =============
 
 arspy
 
 
 git
 =================
 
 == config recommendations
   [push] default=tracking
 
 == tracking
   # creates a local branch, tracking the remote, witht the same name as the
   remote
   gco --track origin/name_of_remote_branch
 
 == remove need for `origin master`
 [branch "master"]
   remote = origin
   merge = refs/heads/master
 
 == remote branches
 #remove remote
 git push origin :<remote_branch_name>
 
 #refresh list
 git remote prune origin
 
 
+haml
+=========
 
+Surround tag with parens:
+    = &quot;(%s)&quot; % link_to(&quot;Edit&quot;, ...)
+
+
 *nix
 =========
 
 ncdu: disk usage
 lsof: who is using file
 
+== file count (-f: don't sort)
+  $ ls -f | wc -l
+
+== clear a file
+  $ echo -n &gt; file
+
 == fix 'no init': 
   $ sudo fdisk -l
   $ sudo fsck /dev/sda1
 
 == boot record
 update-initramfs -u
 update-grub
 
 == Who is serving on port 3000?
 lsof -w -n -i tcp:3000
 
 == redirect stderr to null
 find /Volumes/Space -name 'cx_production*' 2> /dev/null
 
 == ascii art
 figlet:
 http://www.go2linux.org/figlet-create-nice-signatures-emails-forums-usenet-708.ht
 l
 
+== cd in bash?  source it
+. cdd karma
 
+~/bin/cdd
+sub_directory=$1 
+working_dir=`find ~/develop/ -name $sub_directory -type d`
+
+if test -d $working_dir; then
+  echo &quot;cd to $working_dir&quot;
+  cd $working_dir
+...
+
+
 osx
 =============
+eject disk: 
+    drutil eject
 
-dscacheutil -flushcache
+dsn cache: 
+    dscacheutil -flushcache
 
 == File Dialog
   Go to folder:      CMD + SHIFT + G
   Show hidden files: CMD + Shift + .
 
 launchctl unload [~]/Library/LaunchDaemons/xyz.plist
 
 mysql.server stop
 
 nginx -s stop
 nginx #starts
 
 pbcopy, pbpaste  (pb==pasteboard)
 
-rails
-=====
 
-Load optimization:
-    $ time script/rails runner &quot;puts 1&quot;
-
-sinatra
-========
-
-console: tux, http://tagaholic.me/2011/04/10/tux-a-sinatra-console.html
-example, request.accept (compares w/o lib):
-http://97.107.136.245/github/sinatra/sinatra-contrib/master/Sinatra/RespondWith
-
-
-share
-==============
-http://drnicwilliams.com/2008/06/18/what-is-gitjour-gemjour-starjour/
-
-
 passenger
 ===================
 
 == refresh against apache
   cd /usr/local/src/passenger
   sudo rake apache2
   sudo /etc/init.d/apache2 restart
 
 
+rails
+=====
+
+Load optimization:
+    $ time script/rails runner &quot;puts 1&quot;
+
+
+rspec
+======
+
+each matcher:
+http://xtargets.com/2011/08/12/rspec-meta-expectations-over-collections
+
+
 ruby
 =====================
 
 #!/usr/bin/env ruby
 
 ==log_buddy
 require 'lib/log_buddy'
 LogBuddy.init
 
 d { @a } # logs "@a = 'my var'"
 
 
+share
+==============
+http://drnicwilliams.com/2008/06/18/what-is-gitjour-gemjour-starjour/
+
+
+sinatra
+========
+
+console: tux, http://tagaholic.me/2011/04/10/tux-a-sinatra-console.html
+example, request.accept (compares w/o lib):
+http://97.107.136.245/github/sinatra/sinatra-contrib/master/Sinatra/RespondWith
+
+
 ssh
 =====================
 
 == add my public key to remote server (no more password)
 cat ~/.ssh/id_rsa.pub | ssh user@hostname 'cat >> .ssh/authorized_keys'
 
+== Display fingerprint
+    $ ssh-keygen -l [-f file_name]
+
+
+tdd
+===================
+
+TDD Maturity Model: http://codemanship.co.uk/parlezuml/blog/?postid=1066
+
+### Rake
+ * http://robots.thoughtbot.com/post/11957424161/test-rake-tasks-like-a-boss
+ * http://robots.thoughtbot.com/post/159805695/testing-rakes-integration
 
 vim
 ======================
 
 Move among windows: Cw<direction>
 Repeat command (not just text):Cp = :<up arrow>
 Format code: gg=G (top, format, bottom)
 Ext cmd to buffer: :% !html2haml %
 Spell checker (MacVim): set spell
 Find/replace across multiple files:
   :args app/views/**/*.*
   :argdo %s/test/)/gce | update
 
 == ascii art
 read!figlet -c 'Q&A'
 vim:nolist
( add new | see all )