Showing posts from September, 2010

IntelliJ move a word forward on a Mac

IntelliJ move a word forward on a Mac Option/Right Arrow

Run java simple bash one liner - jar runner with jar classpath expansion

#!/bin/sh java -classpath $( echo ./lib/*.jar . | sed 's/ /:/g'):./build/somejar.jar:./build/classes $*

Bash expand Jars for Java classpath with wild card

java -classpath $( echo ./lib/*.jar . | sed 's/ /:/g'):./other-lib/somejar.jar:./build/classes com.apache.ClasswithMain

Textmate Ruby Macro - Unquote Lines

Textmate Ruby Macro - Unquote Lines #!/usr/bin/env ruby -wKU STDIN.readlines.each {|e| print e.gsub(/"/,"") ;  } #Set Save "Nothing" #Set Input "Selected Text" or "Character" # and #Set Output "Replace Selected Text"

Textmate Ruby Macro - Quote Lines

Textmate Ruby Macro - Quote Lines #!/usr/bin/env ruby -wKU STDIN.readlines.each {|e| print '"'+e.gsub(/\n/,'"'+"\n") ; print ""+(e.include?("\n") ? "" : "\"\n")  } #Set Save "Nothing" #Set Input "Selected Text" or "Character" # and #Set Output "Replace Selected Text"

Disqus world's largest django powered site

This presentation show cases the list of this Disqus did to scale it's implementation.  Looks like a nice clean implementation.

This is what happens when you let google write a sentence

Google scribe created run on sentence by typing in the word autocomplete then hitting enter till it stopped and this is the sentence I got. autocomplete in their own right and do not want to be related to their particular field or industry in which they are attached to their respective owners and are strictly for viewing and printing of these books are nothing but another form of therapy for these patients is not known whether these are the only ones.

Git Ruby Combo - hooks and preventing checkins

Here are two example from the article below  Slaying dragons with git, bash, and ruby a on pre-commit hook for git. First setup your hook that will run before you commit. chmod +x .git/hooks/pre-commit Second test out a test for ruby debugger code left, when it should be removed #!/usr/bin/env ruby if `grep -rls "require 'ruby-debug'; debugger" *` != "" puts "You twit, you've left a debugger in!" exit(1) end Now whenever I try to commit code, it will first run a recursive  grep  over the codebase to ensure I’ve not left my debug statement in (I can be sure it always looks like “require ‘ruby-debug’; debugger” as I have it bound to a shortcut). Another example included Stopping an incomplete merge There’s been occasions where a particularly large rebase or merge creates a lot of conflicts in a file, and one of those has snuck through and rather than being fixed the inline diff has actually been committed. Time to add another check t