Languages of interest
I’ve been tinkering with a lot of other languages recently, here are a few of them. What languages are you looking at?
I’ve been tinkering with a lot of other languages recently, here are a few of them. What languages are you looking at?
Recently I decided to try a stand up desk again. I’ve used one a few jobs previous where I had to assemble all manor of electronic devices and rather liked it. At home this has the duel benefit of keeping me focused, and keeping my son out of my computer equipment.
I’ll keep you up to date with how it goes. I’m interested to see how standing at home and sitting at work compare with regards to comfort.
Another turn around the textile wheel of fortune in a rails application today yielded a lesson learned long ago but forgotten. The textilize helper included with rails enables the hard_breaks mode by default. Hard Breaks converts 1 new line to a br and 2 newlines to a p tag. When you disable hard breaks mode you only get p tags.
Here’s how the source for that method looks:
def textilize(text)
if text.blank? "" else textilized = RedCloth.new(text, [ :hard_breaks ])
textilized.hard_breaks = true if textilized.respond_to?("hard_breaks=") textilized.to_html
end
end
Here’s a simple override of it you can put in your application_helper.rb if you want the no hard breaks behaviour.
def textilize(text)
if text.blank?
""
else
RedCloth.new(text).to_html
end
end
Nothing new, just posting it here as a reminder to myself and a hopefully helpful tip to anyone not yet familiar with this difference.
Be lazy enough that you don’t want to use one of the plentiful svn add scripts on the net.
Decide, hey, I can make that happen with fewer characters!
Try to run the following in your sleek zsh shell:
svn add **/*So, this step is awesome! It adds all the new files, while not re-adding existing files. It also has the added benefit of scrolling so much text in your console you have time to get a refreshing drink.
However, the last step has the added benefit of adding svn ignored files by calling them as explicit targets. This gives us a wonderful experience of learning how to selectly svn revert everything our nuclear svn add option just did.
So what have we learned? Sometimes globs do not solve all problems. Most perhaps, but definitely not all. Also, I’d like to give a shout out to my friend subversion, who enabled me to rollback this mess of a command.