Posts

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. http://www.slideshare.net/zeeg/djangocon-2010-scaling-disqus

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. http://scribe.googlelabs.com/

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...

How to recover a text from from rm

This is a clever technique if some txt and relative size of the file is known grep -a -B 25 -A 100 'some string in the file' /dev/sda1 > results.txt Here’s what the command does: grep searches through a file and prints out all the lines that match some pattern. Here, the pattern is some string that is known to be in the deleted file. The more specific this string can be, the better. The file being searched by grep (/dev/sda1) is the partition of the hard drive the deleted file used to reside in. The “-a” flag tells grep to treat the hard drive partition, which is actually a binary file, as text. Since recovering the entire file would be nice instead of just the lines that are already known, context control is used. The flags “-B 25 -A 100” tell grep to print out 25 lines before a match and 100 lines after a match. Be conservative with estimates on these numbers to ensure the entire file is included (when in doubt, guess bigger numbers). Excess data is easy to trim out of res...

Natural Watering Holes NY, CA, AZ

Image
I hope I get to make it to all these places but NY and AZ look the prettiest to me Peekamoose Blue Hole, Sundown, NY If this place doesn’t remind you of old Mountain Dew ads, you’re probably part of the Twilight generation. You know the ones—groups of beautiful young people playing in the summer sun, jumping into water, popping open a can of the electric yellow soda, while a singer reminds us that “being cool is a state of mind.” In the middle of a Catskills forest, Rondout Creek pours through a rock gap to create a deep swimming hole worthy of such rowdy camaraderie. Think jackknifes and cannonballs. The I-live-for-summer rope swing dangles over the deepest end and practically begs to be used. To find the Peekamoose Blue Hole (and your inner Brad Pitt), follow New York Route 28A to West Shoken. Carlon Falls , Yosemite National Park, CA En route to Hetch Hetchy, pull off winding Evergreen Road at the South Fork Tuolumne River for a mostly flat, two-mile hike to this rare year-round wa...

How to hire a programmer

How to hire a programmer. I read this article and said great this is exactly what I tell people with a twist. Basically the steps are: Simplify your idea to smallest possible version of it. Simplify some more Summarize this idea using lots of verbs and nouns, also imagine describing things if I click A then B happens. Break down this simple project into Deliverables or Milestones. THE TWIST HIre multiple developers to complete the first Milestone. Pick the best developer to complete the rest of the Milestones. Original

Venture Capital

I am talking to the world out there... What are the VC's saying? Check out the latest in iPhone mobile. http://www.mobilecrunch.com/2010/04/08/everything-you-need-to-know-about-iphone-os-4-0/

Torn - business, engineering, venture capital vs random thoughts

I am a little torn, because I don't write enough to have multiple blogs worth of content. Additionally people don't like to follow blogs that are all over the map. Basically my content is a little too diverse(lately very tech heavy) to keep an audiences attention. What to do what to do.... Not really sure about that one. I have followed a few of my friend blogs as of late ... they are pretty good. Writing has never been a strength of mine, but a skill that I admire in people none the less. I really want to improve my writing. Did you know that Benjamin Franklin had a very interesting technique growing up when he discovered his writing was poor. He would read a famous essay or article by a master writing, summarize it's main points. They try and rewrite the article making the same points. Then afterward would do a comparison of the two. This helped make Benjamin Franklin become the great writer he was. I might try doing that one day if I can find the time. Friends...

How to start a single hadoop tasktracker

/usr/local/hadoop/bin/hadoop-daemon.sh --config /usr/local/hadoop/bin/../conf start tasktracker

How to start a single hadoop datanode

/usr/local/hadoop/bin/hadoop-daemon.sh --config /usr/local/hadoop/bin/../conf start datanode

Excel short cut to edit the active cell in a mac

Control U will let you edit the active excel in a mac

Learning Software Maintenance from old continuous systems

Great software article promoting continuous software maintenance model which was invented in some systems over 40 years ago. You Don't Know Jack About Software Maintenance We can learn a thing or two for modern software development

Apple App Store Process is Frustrating

I have had lot's of frustration with the App Store process. Namely with the feed back on rejections being so poor. Developers leaving the Apple App Store . I am not leaving but it is a crappy position to put developers in whom put in their own hard time into producing something that might be rejected or floating in limbo for ever.

Programming words of wisdom

1. Either leave the existing brace style the hell alone and live with it, or completely re-write the code. Going the middle road leaves two unhappy parties, leaving it alone or replacing it leaves just one. And while you should err on the side of just living with what’s already there, you shouldn’t be shy about cleaning up a train wreck. 2. Good programs do not contain spelling errors or have grammatical mistakes. I think this is probably a result of fractal attention to detail; in great programs things are correct at all levels, down to the periods at the ends of sentences in comments. “Aw, c’mon! You’re kidding!” You might think that nit-picking like this is beneath you, whereupon I will start pointing out errors in your code. It was embarrassing the first couple times this happened to me. 3. Crack open your current project. Now, delete as much stuff as you can and still have it work. Done? Okay, now toss out more, because I know that your first pass was too timid. Pretend that you’r...

Bash how to write a file using cat and multi line string

Thought this was a cool example cat >hello.go <<EOF package main import "fmt" func main() { fmt.Printf("hello, world\n") } EOF