* You are viewing Posts Tagged ‘Code’

Tried out Shoes

I got bored tonight and wanted to write a little script to calculate the amount of time left in my propane tank. Instead of just doing it in Ruby (or Numbers, for that matter), I figured I’d play with Shoes a little. Then I got bored, and really just spat it out and am done with it.

Anyways, for those curious or who want to calculate the time left in their propane tank, here’s the code:

PROPANE_GALLON_WEIGHT = 4.23
BTUS_PER_GALLON = 91_690

Shoes.app do
stack do
para “Let’s figure out how much time you have left in your … Continue Reading

So, Ruby, you’re kinda plain…

I work almost all day, every day in knee deep Ruby nowadays. It’s actually fantastic, because it’s made so many aspects of my job trivial. Rearranging, shuffling, sorting through collections is a snap. Coding is kinda fun, just because I can knock out stuff so quickly.

It’s similar to my Mac as far as coolness and usability goes. When I converted over to using Apple stuff full time, I lost a lot of interest in hardware and how drivers and crap worked. My computer just works now. I don’t know why your printer doesn’t work, but I can tell you that … Continue Reading

Rails periodically_call_remote and drafts

I’ve been working on an automagic, ajax-y draft saver for posts that people write. To make things slightly more complicated, though, these posts get published for other people (so we can’t show them as drafts to the rest of the site), and we’re using TinyMCE.

If you’ve used TinyMCE, then you know how it keeps its own iFrame up where peope edit text, and it hides the corresponding textarea, and changes the textarea on form submit so it gets posted to the server, so no matter what kind of automated submission you do, you’ll have to add an event handler for … Continue Reading

Enjoy work; Stop sprinting

[Preface: There are at least 4 people who read this blog who could think this post is directed at them. Each of those 4 would be wrong. This post was spurred when a douche at ST told me I didn’t have a “startup mentality” and should be working more like 12 hour days. That wasn’t the reason I quit, but that was the kind of bullshit mentality at ST.]

This post has actually been a few weeks in the making, mostly because I’ve been slammed moving and working and parenting and husbanding and, yeah, for whatever fault you can think of, … Continue Reading

Language Snobs

Last week one of the guys on my team left us. It was disappointing, because the guy seemed to be really smart and it’s always sad when a really smart guy goes. He said it was because of a better opportunity at his new place, where he’d largely be working from home, and that he’d get to use Python. He’d commented several times that he thought Ruby was immature compared to Python, but I hadn’t thought much of it.

Anyways, I stalked him on the web after he left and found a blog post he wrote explaining why he left, and … Continue Reading

Lessons in Consulting

In December of last year, Jeremiah and I started a company, Navoty. We’ve learned a ton since then. Here’s a few items:

Time is valuable 

Neither of us realized this at first, and were putting in 30-50 hours on top of our full time jobs to power Navoty. This leads to a few things: burnout (who can sustain 70-90 hour weeks?), angry families (wives and kids need attention!), and unrealistic expectations. We were doing lots of work and getting paid for it, but the short term income boost was met with the realization that we were fairly strapped and … Continue Reading

Unempirical comparison of Tweeters

I was talking to a guy on Twitter the other day, and commented that there’s a stark difference between .NET driven codemonkeys and the rest of us codemonkeys. Now, I realize that I’m probably drawing on the wrong criterion, and that all of the .NET people I follow on Twitter are also super-agile evangelists, but I have other friends on Twitter who are agile-koolaiders and tweet significantly different.

You can tell a .NET tweeter from the following criteria:

90% of posts are about work
>50% of posts are about Microsoft
<20% of posts are about family, friends, fun, etc.
Tweets aren’t complete thoughts and generally … Continue Reading

Time commitments can pwn you

Sara and I went looking for houses today, and as we’re talking about the merits of one of the houses, she says to me, “I want to stay in this house for a *long* time.”

That got me thinking. First off, for anyone who knows me, I change jobs. More than most people you know. I don’t get fired; I go somewhere that looks like a better fit.

Initially, when I’d look for a job, I’d tell the guys, “I want to work here a long time.” I realize now that this makes no sense. What’s the point of committing … Continue Reading

Lawdy Lawdy Vulnerability Hawdy

Let me preface this post by saying that I’m a huge fan of dynamic programming. Code that writes code is awesome, and can save a lot of time. I got a little crazy today with some class method magic around polymorphism using eval. Specifically, I wrote something like this (simplified for the sake of argument):

def self.describe(type)
eval(”#{type}.new.describe”)
end

Now, this code is meant to take a subclass (string), instantiate it, and call its describe method (which, if you’re curious, makes a describe call against Salesforce). Pass it something like “Contact”, and you’ll get everything just fine and dandy. Now, by itself, this isn’t … Continue Reading

Bury the children, save the servers

“In many societies, whenever a new building is constructed, it was thought only prudent to pacify the local deities by burying children beneath the foundations (this is how faith sometimes operates in a world without structural engineers).” - Sam Harris, Letter to a Christian Nation

I came across this bit and thought about software. I’d be lying if I said I’d never put out anything and looked for random signs that things were going to be ok. Odds are, you’ve done it too. If only I’d had a few children (not my own, obviously) to bury beneath the servers!