Should I Stay or Should I Go...
05 Dec 2011Gowalla was acquired by Facebook and I’m left with a decision of what to do next.
Gowalla was acquired by Facebook and I’m left with a decision of what to do next.
Congrats, you did a killer presentation or screencast, now you want to upload it to the interwebs and share with the world, but what service should you use? I’ve used both YouTube and Vimeo and wanted to compare and contrast the two.
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.
This is a re-post of an article I wrote for Gowalla’s Engineering Blog. You can view the original article here.
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.
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:
@user = User.find_by_username('schneems')
@user.like! @comment
And that’s it. The comment now reports the details of the like.
@comment.like_count #=> 1
@comment.likes #=> [#<Likeable::Like ... >]
@comment.likes.last.user #=> #<User username: "schneems" ...>
For Rails apps, Likeable is extremely simple to set up.
First, add Likeable to your Gemfile
:
gem 'likeable'
Set up your Redis connection in (e.g.) config/initializers/likeable.rb
:
Likeable.setup do |likeable|
likeable.redis = Redis.new
end
Next, add the Likeable::UserMethods
module to your User
model:
class User < ActiveRecord::Base
include Likeable::UserMethods
end
Finally, add the Likeable
module to any model you want to be likeable:
class Comment < ActiveRecord::Base
include Likeable
end
To learn more, check out the Likeable source, look at the example Rails app or watch the Likeable screencast.
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.
This is a re-post of an article I wrote for Gowalla’s Engineering Blog. You can view the original article here.
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
You can get even more helpful stuff through this handy cheat sheet https://cheat.errtheblog.com/s/git. Good luck and happy Git-ing
I use PRY to develop Rails, so should you: Set up Pry with Rails
I use the .pryrc method, works great. I can reload! and still get the magic of Pry.
If you’re new to pry check out this intro: Pry Railscast
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