Malicious enjoyment derived from observing someone else’s misfortune
 

Tag Archives: ruby

The Chronic: A Ruby Time Library

So, I was trying to use Ruby to get the date 6 months ago.  This is usually accomplished using the core extensions in ActiveSupport, which is OK, but it was too much work.  Then, I found an awesome article talking about Chronic, a minimal date/time parsing library for Ruby: $ irb -rrubygems -rchronic irb(main):001:0> Chronic.parse(’6 months ago’) => 2010-03-25 21:10:10 -0400 Wow that’s like so awesome.  I wonder what else it can do… irb(main):002:0> Chronic.parse(‘three days after memorial day’) => [...]

Quick Markaby note about conditional attributes

Say you want to set an option tag to selected only under certain conditions without the code getting really ugly. Do this!: I was messing around with the ternary operator in other ways inside the element, but none of them actually interpreted properly. I hope this helps someone else struggling with this issue…

Ruby to generate RSS feeds for sites that don’t offer them

There’s this site that has an equipment exchange I wanted to keep track of. Yet, it’s done with what seems to be a custom php file rather than vbulletin, so none of the usual RSS feeds from the site apply to it. So, I decided to make a scraper/feed-generator to get me the latest version every 5 minutes and generate a nice RSS feed, so I can view it in Google Reader. The volume of posting is low enough that [...]

OSCON Sessions, Day 2

Oh man, what a day. I attended quite a few talks, grabbed a lot of swag, and entered a few contests. I ended up buying the Arduino Starter Kit from MAKE so I can do some awesome embedded Ruby like I saw at FOSCON. It looks really fun – I can’t wait to try it out. The talks I attended were half-way decent, but I learned a lot more on the first day. Hadoop and EC2 A good overview of [...]

OSCON Sessions, Day 1

I went to 5 sessions today, and I was pleasantly surprised by most of them. CouchDB CouchDB is a distributed non-relational database written in Erlang. It is unique in that its main query interface is simply HTTP REST, and for every UPDATE, it simply creates a new version of the row. Additionally, you can request the entire history of a row very simply. Hypertable An open-source implementation of Google’s bigtable. Hypertable uses novel methods such as Bloom filters to significantly [...]

Pradipta’s Rolodex Epic Conclusion

If you don’t already know about Pradipta’s Rolodex, read up here Here’s the epic apology email from THE MAN HIMSELF!: Hi All, First of all I just wanted to say I apologize for the emails I sent. As of today I promise to stop the Email marketing campaigns. And I do believe it was a very…very..stupid mistake, this is the result of working late. Also, I am deeply amazed of how talented you guys are. I mean seriously all this [...]

DNS for bash

Today, I decided I wanted a network service that propagated variables and aliases to every login shell that subscribed to it. This is dangerous on a large scale, but perfectly acceptable on my small home network where everyone trusts everyone else. First, I got Camping installed, bringing back fond memories of Ruby development. I then copied off the blog example, and created TreeHugger, a 427 line script that provides a web interface to edit the variables, and a plain text [...]

How to make a Flash Line Chart in Rails using Ziya

Ziya is pretty cool, and the documentation is slowly starting to surface. I was annoyed that I couldn’t find a good example paste of how to make a line chart. Then I watched the screencast. It’s the first example he does, so I’m posting it here so those who can’t watch it can actually find out how to do it. I’m going to operate on the precondition that you’ve installed Ziya and included it in your controller properly. Do the [...]

Photoslice in Bluecloth and Mephisto

So, I found this today, and it is awesome. I wanted it in Bluecloth so I could use it in Mephisto. Here’s how. First, I needed to make it so I could still do normal images, but turn on coolness if I want. Here’s the goal I came up with for the grammar: [![](thumburl.jpg)](imageurl.jpg “Scrolly Text at top” “photoslice”) Here’s the first test, with a single image: And now a set with a namespace: I did it by simply modifying [...]

Flash Chart Testing

I’m testing a flash chart plugin based on this.