-
MongoDB: Warts and wobbles
I’m a huge fan of MongoDB - after years in MySQL, Interbase, and Postgres SQL databases, it was quite a breath of fresh air to get to try a document database on for size. I’ve more or less adopted it as my default data store for web applications, due to a number of awesome features that many people have enumerated elsewhere. Rather than yet-another post about why MongoDB is great, I figured I’d talk about the things I don’t like in it, the places I’ve had difficulty with it, and the things I’d like to see improve. Knowing the sticky parts of a piece of technology is often as valuable - if not moreso - than knowing what it does really well. I absolutely still recommend it as a data store, but it’s not a magical panacea, and I want to take a realistic view of it. …
-
Tarot for easier Rails configurations
Once upon a time, I wrote a quick-and-dirty Rails plugin for site configuration. Since then, I’ve continued to use variants on this pattern, and it’s evolved to the point that it deserved a revisit. …
-
Sexy CSS Scrollbars in Chrome
It’s like it’s 1996 all over again, except with less suck. Webkit now supports styleable scrollbars, and you get to use all the Webkit CSS3 goodies, like gradients and rounded corners and the like. If you’re using Chrome or Safari, you might notice that I have the blog theme rocking super sexy grey scrollbars now, which really ties the whole theme together. It’s pretty easy, too. …
-
Making HAML faster
Haml’s among my favorite of the Rails technology stack. Clean, self-correcting templates that mean less typing and more doing for me. I love it. …
-
JRuby Performance: Exceptions are not flow control
I started playing with JRuby tonight, and got my application up and running on it in under 10 minutes (kudos to the JRuby team!), but when I started measuring its performance, I was seriously unimpressed. This didn’t quite line up with what I’ve read of JRuby, so I decided to do a little digging. …
-
Mongrations reloaded
Users of MongoMapper may be familiar with mongrations, a Rails plugin to provide you with ActiveRecord-style migration tools for MongoDB. You don’t need them for schema changes, obviously, since MongoDB is schemaless, and you can define any changes you need to in your model. However, there are times that deploying a changeset will require some data change, or some maintenance stuff to be run. For that, mongrations is super helpful. Or was. …
-
Rails, Varnish, Cookie Sessions, and CSRF tokens
I’ve recently been trying to figure out how to get Rails to place nicely with Varnish. It doesn’t do that very well. In a nutshell: …
-
Mobile and secure - setting up OpenVPN with DD-WRT and Android
So, with all the hubbub about Firesheep lately, and the fact that I’m becoming more mobile in my computing, I figured that it was time for me to get a VPN set up. I didn’t want to pay for one, and hey, it turns out that I have all the tools I need to manage my own. …
-
Hack night at Gangplank
So, I finally made it down to Gankplank. I’ve been meaning to get down here for a while, but I’ve just not made it happen. I took the weekend to get my development environment up to snuff on my laptop (so I can actually work anywhere now!) and decided to give it a shot. …
-
Solving error n8156-6003 when trying to play Netflix Watch Instantly content.
This is mostly search engine bait, because I couldn’t find a solution on my own when searching, but managed to stumble across it anyhow. …
-
Write-once read-only fixtures for Rails tests
In the project I’m currently working on, I’m heavily using factory_girl to generate test data, rather than using the old Rails fixtures standby. However, I still have a set of read-only fixtures (which are used for testing read-only models against a legacy database). I’m using these in my tests, but since they are read only (like, seriously - the models are marked as by using
after_find
to callreadonly!
, ensuring that records will not be accidentally written), there’s no need to wipe and re-insert them per-test. …
-
Pain-free CSS3 with Sass and CSSPie
So, you have a great design for a site. Lots of rounded corners, soft shadows, and beautiful gradients. “This’ll be fun!”, you think. …
-
MongoMapper, Development Mode, and Memory Leaks
If you’ve worked with MongoMapper for a while, you’ve probably noticed that in complex apps, there are horrific memory leaks in development that magically disappear in production mode. While this is all well and good, and it’s rather handy that things Just Work in production, don’t you wish you didn’t have to restart your app server every 15 requests in development? …
-
Debugging memory leaks in Ruby with GDB, round 2.
In part 1, I described how I located leaky
Set
s in MongoMapper by diffing the Ruby ObjectSpace with GDB. Today, I’m going to show you how to solve the problems that those sorts of diffs can reveal. In today’s example, we’re tracking leaky sets. In particular, a set is holding onto class references. We are going to: …
-
WillPaginate and custom paging.
will_paginate is the de facto Rails paging plugin, and with good reason - it’s solid, fast, and reliable. Everyone I know uses it, but a lot of people don’t use it to its full power. …
-
Setting up replica sets with MongoDB 1.6
Introduction
…
-
Click mapping with HTML5 and node.js
I was recently in need of a click mapping solution, and didn’t like most of the solutions I came across. They had huge dependency chains and were generally unwieldy, or they didn’t work that well, or they were external services that I had to pay for…until I ran across heatmapthing. Now we’re talking. Client-side rendering of JSON location data - we’re in business! …
-
FlexAuth: Portable authentication for Battle.net
I’ve just released my first Android app, called FlexAuth. It’s mostly an excuse to learn Android development, but it does something useful, too - it serves as a souped-up mobile authenticator for Blizzard’s Battle.net login infrastructure. If you’d like the gory details, there’s a specification floating around on the internet that’ll help you understand the protocol. …
-
Serving files out of GridFS, part 2
Since my initial experiments with GridFS and nginx-gridfs, I discovered a rather downer of a dealbreaker: compiling Passenger and nginx-gridfs into the same nginx binary makes nginx very unhappy. It hard-freezes (as in, blocks forever) when you request a GridFS file with Passenger enabled. Oops. …
-
Serving files out of GridFS
GridFS is a nifty little feature in MongoDB that allows you to store files of all shapes and sizes in Mongo itself, getting the benefits of Mongo’s sharding and replication. However, since they’re in a database, and not on the filesystem directly, how do we serve them? …