occasionally useful ruby, ubuntu, etc

25Oct/100

ReReplay: Replay production traffic

Ever wonder if your change is going to slow down the website? "Performance impact will probably be negligible", you might say. Well, now you can know for sure. First, take a slice of your production logs and transform it into a particular format. Then run ReReplay with this snapshot to generate a baseline. Next apply your change, rerun ReReplay (sorry, too many re's?) and measure the difference!

5Sep/100

Easy way to generate “release notes” on GitHub

Assuming you're using tags with your git repository on GitHub, it's rather easy to generate something resembling "release notes"; or at least, a list of descriptions of all changes between two tags. That's pretty much the same thing, right? Anyway, if you go to "/compare/tag1...tag2" under a project on GitHub, it'll show you everything that changed between those two tags. Here's an example: Radiant's changes between 0.9.0 and 0.9.1. Neat, huh? If not used as the actual release notes, it can at least help you remember all that changed between two releases when you handcraft a list yourself.

This feature was announced March 1, 2010, but it's hard to find unless you know you're looking for "compare view" :) . It's also sort of hard to find -- you have to go to the Source tab, then Branch List, then hit the Compare button on a random branch, and then, finally, you can input a start and end tag in the upper right. Easy to find, no?

Filed under: musing No Comments
2Sep/108

Announcing Crow, a path-finding library in Javascript

Over the past few weeks I've been building out a clean and fast path-finding library in Javascript with a particular gaming site in mind, and I'm pretty happy with where it's at right now. If you're interested in at least one of: API design, Google Closure library, Google Closure compiler, or QUnit, then hit the jump for more. In the future, I'll cover Javascript (and object-oriented patterns), path-finding (breadth-first search, Dijkstra's algorithm, and A*), rake, games, and the embedded Sinatra+Bundler.

31Aug/100

How we got here: Web App Stores

The recent sudden popularity in web "app stores" is taking off with a rate normally associated with fads, but in some respects is actually to be expected. Still, it bears an interesting similarity with one of the oldest types of websites that the average consumer has seen: directories.

11Jul/100

Grandparent of Ruby and Java: Eiffel and friends

I'm curious about the effort involved in writing a new programming language, and hence have been doing a little research (including watching Guy Steele's now-famous and amusing Growing a Language lecture). I know I want to target the NekoVM (primarily one of the targets of haxe, for now), but what languages should I base it on? One of the languages I've heard a good deal about about, mainly based on its design-by-contract principles, is Eiffel.

(even if you're not interested in building a new language, learning about programming languages and their design decisions increases our understanding of them and, hopefully, our proficiency with them)

11May/1072

Attaching a sticky (fixed) header/footer to an Android ListView

In my Android app, I have a ListView, and I want to persist a button at the bottom of the page (like how the Gmail app has Archive, Delete, and Older on the View Email screen). Unfortunately, this is not trivial, and many others have tried, but despite those suggestions, I never found something that quite worked correctly. The third article above got me actually pretty close, so without further ado, here's a working solution (images and javascript include after the jump):

Filed under: android Continue reading
6Mar/1018

HTML5 Web SQL Database – Intro to Versioning and Migrations

I've been dabbling a bit with Chrome extensions, which have at their disposal HTML5 localStorage and Web SQL Database. And...the web sql database especially is pretty cool. But one thing was bothering me -- if I have a database on the client, how do I maintain the schema? The (simplest) answer is in changeVersion.

Tagged as: , Continue reading
24Jan/100

Beet, Barley, and Black Soybean Soup

For fun I transcribed my girlfriend's recipe into Ruby code that could theoretically execute, given the proper support classes. No I'm not doing much today, why do you ask?

Filed under: food Continue reading
23Jan/1020

A brief introduction to Ruby, Sinatra, and Haml

Ruby and Sinatra make it ludicrously easy to make a webapp, but getting started, as with any new language or framework, can be daunting. By the end of this part, you'll have a simple template that talks back to you!

12Dec/090

Destructors in Ruby? Not quite…

So I was curious to see how destructors work in Ruby, and...they don't. Or rather, the method we do have, ObjectSpace.define_finalizer, is rather restrictive. But it does leave a loophole -- the callback method receives an object_id.