Video and Slides from a guest lecture I presented at the University of Texas school of Information. This is an introduction to relational and non-relational databases and how their performance affects scaling a web application.
First off, I love Stack Overflow. In the way that only someone who taught himself programming via outdated books, and old-school programming forums can. I think it’s the best way to ask most programming questions on the web, but that doesn’t mean it can’t get better.
Likeable is a new open-source Ruby library that we built here at Gowalla to power all of the “loves” on stories, comments, highlights and photos that you see. It’s built on top of Redis to be extremely simple, isolated and fast. Likeable plays well with ActiveRecord objects, but can be used with any Ruby object that implements an #id method.
To see it in action, head over to my Gowalla profile and love the first thing you see. Immediately you’ll see the heart change colors and the love count increase by one. If you click on that number you’ll see everyone who has loved that object.
This might seem trivial at first glance. But consider that dozens of elements on the page must pull this information: how many people have loved it, whether the viewer has loved it, and (on some pages) which of your friends have loved it. Using Redis allows us to stay simple, flexible and fast.
The Code
Let’s say we’ve got a comment made on a recent Gowalla story.
@comment = Comment.last
@comment.like_count #=> 0
If our user wants to like this comment, he can do so with ease:
We’d love to get contributions to Likeable. If you want it to do something it doesn’t already, open an issue on GitHub. Or, if you feel so inclined, create a patch and submit a pull request.
Gowalla started and engineering blog, highlighting our open source projects and giving all of us devs a special place to talk about things we care about.
Ever see someone checkout a git repo by simply typing `git co master` instead of the HORRIBLY LONG IMPOSSIBLY DIFFICULT `git checkout master` ? I know I have, so to save me HOURS a day I added these aliases to my ~/.gitconfig to my git config file.
[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
dc = diff --cached
lg = log -p
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
ls = ls-files
I use custom organization of my .bashrc and .bash_profile i.e. my “dotfiles”. Its great to keep all of my aliases clean and organized. I highly recommend Peepcode’s Advanced Command Line for more info on configuring your own set of custom dotfiles.
The one thing I always forget how to do whenever I move to a new computer or hard-drive is to set up the correct files and set up the proper sourcing, so here is my shorthand note to my future self.
# First copy files to ~/bin/dotfiles
# Open bashrc
mate ~/.bashrc
# Paste this in
```
source ~/bin/dotfiles/bashrc
```
# Open bash_profile
mate ~/.bash_profile
# Paste this in
```
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
When i first started working for Gowalla, I implemented some UX improvements to the existing login form. I thought it was pretty nifty and so did SmashingMagazine. Check out their writeup