1. Aug 11th, 2010

    Vanity 1.4: Connection adapters

    Vanity 1.4 introduces a lot of new features specifically around metrics and data storage.

    Connection Adapters

    First, connection adapters. Not just for Redis. Well, right now there are only two of them, one for Redis and one for MongoDB, but adding another database adapter is no longer a painful exercise.

    In fact, here’s your chance to help. Adopt An Adapter. Either write one from scratch, or take ownership of existing adapter and make it better/faster and help maintain it in future releases.

    Version 1.4 also introduces new configuration file, config/vanity.yml, easy way to configure adapters for different environments. For example:

    production:
      adapter: mongodb
    development:
      adapter: redis

    But you probably don’t need to configure test environment, see Playground.collecting below.

    Upgrade Your Data

    Rolled in there is a switch to the newer Redis library, and some cleanup to the way data is stored, which makes Vanity 1.4 incompatible with 1.3.

    If you want to access the metric and experiment data, you need to tell Vanity to upgrade the database’s contents:

    $ vanity upgrade

    Mock is Dead, Long Live Playground.collecting

    Vanity 1.3 actually had two adapters, Redis and Mock. The Mock adapter is still there in 1.4, but I’m thinking of deprecating it in favor of a different strategy.

    Vanity 1.4 can run in two modes. When collection is turned on, it stores metrics, experiments and other state information in the database. That’s the mode you want to use in production, maybe also in development.

    When collection is turned off, no data gets stored in the database. Some features that do need to hold state (e.g for testing different A/B paths), will hold on to it in memory, but will lose it when the playground is discarded (during test teardown). This is the mode you want to use when running unit and functional tests.

    Under Rails, collection is turned off in all environments except production. If your development environment has more than one process you may need to turn collection on in development as well. It’s as simple as:

    Vanity.playground.collecting = true

    Experimental

    New page that covers work-in-progress features and ideas for future releases. Check it out if you want to know what the future holds, or just interested in picking a cool feature to contribute to.

  2. Jul 26th, 2010

    Rounded Corners 256 — Sharpening the saw


    Customizing IRB, 2010 edition. IRB customization with wirble, hirb, awesome_print and a few others choice libraries. What makes Iain’s .irbrc so awesome is the way it handles loading of dependencies (which may or may not be available).

    A few git tips you didn’t know about. Guaranteed to make you a Git Ninja, or at the very least, much more productive with the command line.

    Terminal Tips and Tricks For Mac OS X. Just what it says on the label.

    Upstart — event-based init daemon. The new alternative to sysvinit. Not so new chronologically, but probably new to you. If you’ve using God or Nagios, consider upstarting some of that.

    Awesome Screenshot: Capture & Annotate. This extension (Chrome only) makes screen capture and sharing so easy.

    Incidentally, screenshot of the New revised release calendar.

  3. Jun 29th, 2010

    What’s on your iPad (that you’d recommend in a heartbeat)

    Creating

    Simplenote — Simple clutter-free UI, instant synchronization, iPad and iPhone apps, JustNotes on the Mac, Web access. My go-to note taking, idea dumping, list making, unstructured todo. Should come bundled in iOS instead of Notes.

    Evernote — As much as I love the simplicity of Simplenote, I do end up using Evernote more often. With its multiple notebooks, Web clipper, PDF and image storage, Evernote is my big bucket of bits. I store more stuff for longer, using Simplenote mostly for short-term notes (some of which get copied to and archived in Evernote).

    Adobe Ideas — Did you know Adobe made one of the first, decent, native iPad apps? That alone is worth a few points. Besides, it’s a great little apple for sketching out ideas, annotating screenshots and the occasional doodle.

    iMockups — It’s more fun to use than mockup apps on the Mac (although not necessarily quicker), and I find it helps (a lot) to do early design work on the single-tasking iPad. Focus. Will set you back $10, though.

    Popplet — Popplet exists somewhere between mind-mapping, single-person brain-storming and collaging. The UI is incredibly easy and smooth that I don’t have to think about it, what you’d expect from a true iPad app. This one works, where all the other mind-mapping tools I tried felt lacking. (Tip: there’s a free lite version you can try out)

    Consuming

    Reeder — One of, if not the best iPad app. After Reeder came out I stopped reading feeds on the Mac, at the same time subscribed to more feeds to read. The only feed reader that comes close is Reeder on the iPhone, which I keep around for the occasional DMV visit or weekend Costco check-out line.

    Instapaper — Instapaper guarantees that I will always have more to read than time to read.

    AirVideo — AirVideo is my Instapaper for videos. Download talks and presentations with ClickToFlash, organize and store on the Mac, watch on the treadmill. (Tip: you can boost the volume louder and zoom in before hitting Play)

    Dropbox — DropBox is the easiest way to access files away from the computer. Mark a file as favorite and DropBox will download it and store a copy on your iPad (or iPhone). I use it to read books and reference material (PDFs mostly) offline, and sync videos when traveling (no cable required). (Tip: it can also view Pages, Numbers and many other file types, or open them in dedicated app)

    Kindle — Truth is, between Reader, Instapaper, AirVideo and a healthy appreciation for sleep, it’s been long since I last looked at a book, but mentioning a book reader app makes me look more worldly. Also, I got two books waiting to be finished.

    NetFlix — It’s like having a TV in every room, except the volume could use some boost (AirVideo got that part right)



    I tweet a lot from the iPad, I use Twitterific for that, but I’m eager to replace it with a better Twitter client (anyone know what happened to Tweetie?). This list is for apps I’d recommend to others.

    Helping Hand

    1Password — Rule #1: use a unique password for every site, that way if one site gets compromised, the rest of your online life remains unharmed. Rule #2: use a password manager to prevent entering passwords into phishing sites. Hence, 1Password installed on both iPhone and iPad.

    WeatherBug — What is it about iPad apps that make you walk across the room, turn the iPad on and fire up the app, even though you were just sitting in front of a powerful computer with x5 the screen real-estate? Let me rephrase: how come no one managed to create a weather site that doesn’t suck? At least we got an app for that.

    Dictionary — Because my spelling needs all the help it can get.



    Of course I have other stuff, 3 screenfuls of apps, but these are the ones I keep coming back to, the ones I couldn’t live with out. Well, I could, life just wouldn’t be as awesome.

  4. Jun 14th, 2010

    Rounded Corners 255 — You are what you click

    You are what you click. Everything you wanted to know about user behavior tracking with Google Analytics, Garb and Vanity. By Tony Pitale, for RailsConf 2010.

    Cheating. Finally, cheat sheet for jQuery 1.4.2.

    HTTP, meet CLI. Move over curl, there’s a new and better way to HTTP from the console.

    Better reading. An interesting read from Phil Gyford on the design of Today’s Guardian, and how he went opposite of newspapers by paying close attention to friction, readability and finishability.

    Postmodern databases. You can spot them a mile away by the absence of objective truth, and queries that return opinions, not facts. Also, by most people calling them NoSQL.

  5. Jun 6th, 2010

    My development stack

    The best part about working with frameworks and libraries is that you don’t have to reinvent the wheel.  Someone else did the hard work, and there’s usually more hard work than meets the eye.

    The downside is that they’re never perfect. Other people’s code may be less buggy than mine, but I still run into bugs that I need to patch.  Then there are incompatibility issues, behavior changes from one release to another, and features I have to extend to meet my specific needs.

    Some frameworks and libraries are good for that.  Some, whatever you gained from using them is quickly lost when you have to debug their complex code, get surprised by changing behavior, or struggle to extend them. More than once, I wasted more time using a library than it would take to write it myself.

    Over time I settled on a few choice frameworks and libraries where the balance was in favor of saving time and building from other people’s expertise. Those may not be the most popular choices out there in Ruby land, but they proved to have the best return-on-investment for me. Here’s a list of my current development stack.

    Bundler — I work on several projects at once, maintaining a single environment for all of them is impossible. Bundler makes the Gem management pain go away. Switch to a different project, or even branch within that project, run bundle exec bash and you’re done. Also works great when deploying and getting the right environment in production.

    Capistrano — Speaking of deploying, I have some misgivings about Capistrano, but overall it’s great.

    Rake — Great for breaking complex jobs into smaller tasks. It’s easier to develop and test when working one task at a time, it also allows complex jobs to pick up they left off, for example, when you bump into a bug or the unexpected.

    Unicorn — My production Web server of choice. I also use it for development. The fact that you can run two or more processes at once makes it faster than Webrick, and when you’re doing UI work, waiting for Webrick is cycles.

    Resque — If it doesn’t have to be done synchronously, I push it off to a Resque worker.

    Pipemaster — Pre-forking server for commands. Think Unicorn (and much of the same code base) but for requests that don’t come through the Web: cron jobs, command line, inbound emails, etc. I also use it to manage my Resque workers, since it’s able to hot-deploy new code with a kill -USR2.

    Padrino — A Web framework based on Sinatra. If you like fast, simple and less layers of abstraction between you and HTTP, you ought to check it out.

    JSON/JQT — More and more of the UI I’m working on is going down the path of static HTML pages, JSON data and jQuery templates. Static HTML is easy to cache (on server or client), and JSON data means less load and higher latency. It also doubles as an API.

    Vanity – I use it for A/B testing and as a metrics dashboard. Some of the metrics come from Google Analytics, some from database queries, or collected by Vanity. Having them all in one place is the easiest way to stay on top of things.

    MongoMapper — I recently moved away from MySQL to MongoDB. Lots of reasons. MongoMapper is similar in spirit to ActiveRecord, and the API is similar in many ways, but it’s not a drop-in replacement. I’d say it’s re-imagining what an ORM should be for MongoDB. Love it so far.

    SyslogLogger — All the logs from all the processes and up in syslog.

    Shoulda — The best ideas of BDD with the bullet-proof simplicity of asserts. I use it for unit, functional and integration tests (the later in combination with Webrat).

    OAuth/OAuth2 — You already have a Twitter/Facebook/Google account, why not use it to log on?

    jQuery — D’oh.

  6. May 12th, 2010

    Rounded Corners 254 — Hello World

    Hilarious. A Brief, Incomplete, and Mostly Wrong History of Programming Languages, starting with:

    1801 – Joseph Marie Jacquard uses punch cards to instruct a loom to weave “hello, world” into a tapestry. Redditers of the time are not impressed due to the lack of tail call recursion, concurrency, or proper capitalization.

    Patent pending. Just watched Patent Absurdity: how software patents broke the system.

    In practice. Currently getting familiar and productive with: MonogoDBMongoMapperPadrino, OAuthjQuery templating.

    Re-reader. If you like Google Reader as a feed reader, but don’t like the clutter, give it the minimalistic re-reader treatment:

    I’d seen things like Helvetireader, which is quite lovely, but still doesn’t solve my problems. I wanted the ease of use I had with Reader, combined with a visual experience more like Readability or Instapaper. Now I have it.

    200 Drink. When Friday comes and you’ve got nothing better to do in front of the screen, play the status code drinking game.

  7. Apr 2nd, 2010

    I <3 CSS3

    Ran into this problem with Yaketee, where we can geocode many of our visitors — 66.06% of you are using Firefox — but what do you do about everyone else?

    So I added a map you can navigate. You can pan it around, move the center mark (the motorcycle, but you get different mark each time), or do quick search for an address.

    These may be easy and fun, but they’re not easily discoverable, which means we need something better. Meanwhile I resorted to the “if all else fails, document” approach and added instructions, which I thought would look cool hanging off the left of the map. Something less … ahem … instructional.

    How do you tilt dynamic text?  With two lines of CSS:

    -webkit-transform: rotate(-12deg);
    -moz-transform: rotate(-12deg);

    Granted it won’t work with IE, but then only 2.3% of our visitors are brave enough to surf the Interwebs with IE.

    BTW the arrow is not canvas, not yet anyway, but the image is background and made lighter with opacity: 0.5.

  8. Mar 30th, 2010

    Rounded Corners 253 — Some days the coffee makes you

    Reverse cache like there’s no tomorrow. It’s 2010, and you’d expect people who still think Ruby can’t scale to be invested in that belief of theirs. I’d rather read about the One True tab spacing then yet-another-article-about-scalbility-myths. In spite of that, the second part of this article is excellent, and whipping out a minimal reverse caching proxy to yield 10x performance improvement is smart. And you don’t have to use Ruby:

    The end result is a caching reverse proxy with very few tuning knobs, and behavior that’s not quite HTTP 1.1 correct, but that is very fast, stable, and hackable. It’s probably not actually as fast as it could be, since I piggy backed the implementation onto something that’s doing more than I really need, but it’s good enough

    RESTfully yours. Part of adding geo-locations to Yaketee is finding a database of existing spots we can reuse. A database we can actually use – pro tip: read the terms of service fully before investing in anything. Ideally, a database we’ll enjoy and learning something from using. Enter the Gowalla API. Like everything else they do it’s smart, simple and meticulous. If you want to learn how to do a RESTful JSON interface right, do check it out.

    Matter of perspective. It’s been too long to remember, but it feels right. Dustin Sallings (via Aristotle Pagaltzis):

    git doesn’t have a high learning curve. svn has a high unlearning curve. observe the difference in those familiar with neither.

    Be specific. Follow this good advice (<- walking the walk):

    The one thing I’ve ever found truly important in issue trackers is that people who submit tickets start the names with verbs. I’m looking at your screenshots and seeing “better variable naming” and crying just a little bit inside .We’ve got a rule of thumb inside Stamen that issue names must read like imperatives: “improve variable names”, “delete blah functionality”, “fix broken jimmy-jammers”, etc. Nothing focuses the mind of the reporter like being asked to specify what exactly they’d like to see done, and it’s much easier for a developer to scan a list with actual tasks right in the sentence construction.

    Salt your coffee. No, seriously (I have not yet tried it myself, just passing along):

    The first thing that comes to mind is that salt reduces bitterness. And to be more precise it is the sodium ion (Na+) that interferes with the transduction mechanism of bitter tas

  9. Mar 17th, 2010

    Rounded Corners 252 — Fix the Interwebs

    Fix the Interwebs. You don’t have to be a grammar nazi to love Emend. It’s a simple app that lets you submit corrections to other people’s sites with the click of a bookmarklet. Here are all the corrections submitted against Labnotes. Simple. Awesome.

    Another craving satisfied. Ikea SIGNUM Cord Management. What it says on the label. You can find better porn shots of these on Unplggd.

    MGET. Redis cheat sheet.

    Score card. When can I use … tells you which HTML5/CSS3/SVG features are supported in which browser. In short, we’re waiting for IE to die out.

    Where we go each day. Infographic of the 100 largest sites on the Internet.

    Photo: most awesome couch ever.

  10. Mar 16th, 2010

    Rounded Corners 251 — The darkest URL

    ETA. Check out Culture Code’s Arrivals page. It let’s you know which features are coming to Things and when. It’s also sexy as hell.

    Neat trick. Publish videos using the HTML5 video tag and include this script to make the page fall-back to legacy technology on browsers that don’t support HTML5.

    This could be epic. gem man

    EM.run Everything you wanted to know about EventMachine and didn’t know who to ask. (Skip the blocking Flash and get the PDF)

    The darkest URL. Intranet Secret scatalogs secrets to one of the darkest places of business life: the corporate Intranet.

    Photo, from Halfway Cinema, a blog that captures the exact mid-point of various movies.