Verbose Logging

software development with some really amazing hair

T + G I F R

Articles tagged with "bash"

rc Files and You: Automating Your Project

· Posted in Programming
I gave a lightning talk at RubyConf 2012 in Denver. Man was I nervous. Apparently I did an okay job though, and I'd like to thank all the people who were and took time out of their day to listen to me. Thanks! If you want to view the original talk, the video is here. Scroll to 10:15 to find me, but I recommend watching them all. A few people had more questions (I talked really fast since it was a lightning talk after all) and this was originally…

Bash Brace Expansion For Less Typing

· Posted in Software
Named a file wrong? Need to move it to another directory? No big deal. What if you named a view file foo.haml instead of the proper foo.html.haml? mv app/views/widgets/foo.{haml,html.haml} Does exactly what you think it does. It expands to: mv app/views/widgets/foo.haml app/views/widgets/foo.html.haml Since it's just bash, it also works with git: git mv app/views/widgets/foo.{haml,html.haml} Works within the path too: git mv app/views/{widget,wh…

Simple Ruby Pipes

· Posted in Programming
Here's something I cooked up this evening. Nothing too epic, but it's a neat illustration of metaprogramming with ruby. Ruby allows you to reopen classes and add methods to them. You can also make a Module and include that in a class to add methods. I've added four methods to the Symbol class and overridden one method in the Array class (using alias to keep the old method around since super doesn't quite work). Now we can pipe arrays like bash u…