Archive for Programming

I moved

Stop reading here, it is no longer my hangout. All future posts are being made on TrotterCashion.com. It’s ruby, nginx, and more fun. Enjoy.

Comments

Nyc.rb turns 3!

Well, last Tuesday nyc.rb turned three years old. Of course, we were not content with just turning three, so we decided to start taping our presentations also (By we, I mean me, because I have a video camera and turned it on). Francis gave a testing clinic, while yours truly gave a talk on refactoring. Both talks are available on Motionbox (the Rails video site at which I work) at this playlist.

To make things easier for you, I’ve also embeded the videos after the jump. Francis’s video is first with mine second. Sorry for the occasional fuzzy video quality, I’m still not good at filming presentations.

Read the rest of this entry »

Comments

How to Make Pound And SSL Play Nice With OS X

Though building sites with ssl is cool and gives your users a sense of security, configuring a webserver with ssl can be a royal pain. Thankfully, there’s pound. Pound is a “is a reverse proxy, load balancer and HTTPS front-end for Web server(s).”

Pound is dead simple to setup and configure. Unfortunately, the darwin port for pound is old and does not work. So this guide will help you build pound on your own. Besides, everyone feels cooler after compiling that hot fire. Click on for the steps.

    Read the rest of this entry »

Comments (5)

Ruby Reminder: Array Subtraction

Just a reminder when working with arrays of objects generated with Active Record.

[Model.find(1), Model.find(2), Model.find(3)] -
  [Model.find(1)] != [Model.find(2), Model.find(3)]

This does not behave as you would expect, because array subtraction compares elements on their object ids. Each find generates a new object, with a new id, so subtraction does not work. To get the behavior desired, do this instead:

to_be_removed = [Model.find(1)].map{|m| m.id}
[Model.find(1), Model.find(2), Model.find(3)].
  delete_if{|m| to_be_removed.include?(m.id)}

It’s not as beautiful, but it gets the job done.

Comments (1)

Where am I?

I was really on a roll there for a while, right? A gem of a post every day or so, presentations at meetings, reading on scheme and now, I’m nowhere to be found. Well, please allow me to explain. It goes like this: got new job, quit old job, working both jobs for two weeks until finished with my final two weeks.

So yes, working two jobs is keeping my quite busy right now, leaving very little time for any decent posting. Wait until next week, when I’ll once again make you privy to the thoughts bubbling around in my head.

In the meantime, I’ll leave you with a nice unordered list of what’s been catching my eye:

  • Camping is awesome.
  • Zed Shaw and his Mongrel project rock!
  • I want to build a proxy server in ruby using mongrel and mongrel plugins but don’t know when I’ll have time.
  • I want a piece of software that will scan and parse weather, news headlines, and my top rss feeds, placing them into a video file that I can watch on my iPod.
  • Java will probably move into the same category as VB in my about page.

You can look look forward to (or know to avoid) posts on these topics as soon as I’m able to return.

Comments

Picks and Keyboards

I read an article a few years ago, I believe in Guitar World, written by famed Phish guitarist Trey Anastasio. In it, he explained that one of the keys to being great at guitar is to know how to get to ‘C’ from any other note on the fretboard. Once this is known, he explains, this knowledge can be transferred to every other key.

So what does this have to do with programming? A lot I believe. Read the rest of this entry »

Comments