Skip to content
View interview-questions.md

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

View redis_helper.rb
module RedisHelper
# decode Redis value back to Ruby object
def self.decode(json)
self.new(ActiveSupport::JSON.decode(json)["#{self.name.downcase}"])
end
# encode Ruby object for Redis
def encoded
self.updated_at = nil
self.to_json
View paypal_bogus_gateway.rb
# from: https://github.com/sideshowcoder/active_merchant/blob/192f49762172dc41450d7a3605158d45eb55b83b/lib/active_merchant/billing/gateways/paypal_bogus.rb
require File.dirname(__FILE__) + '/paypal/paypal_common_api'
require File.dirname(__FILE__) + '/paypal/paypal_express_response'
require File.dirname(__FILE__) + '/paypal_express_common'
module ActiveMerchant #:nodoc:
module Billing #:nodoc:
class PaypalBogusGateway < BogusGateway
View keybase.md

Keybase proof

I hereby claim:

  • I am vesan on github.
  • I am vesan (https://keybase.io/vesan) on keybase.
  • I have a public key whose fingerprint is 170B 9C28 719A DB97 3711 EA7B E681 FE54 DF8F C3E3

To claim this, I am signing this object:

View action_mailer_localization_helpers.rb
module ActionMailerLocalizationHelpers
def using_locale(locale, &block)
original_locale = I18n.locale
I18n.locale = locale
return_value = yield
I18n.locale = original_locale
return_value
end
end
View router.rb
# From: http://www.broadcastingadam.com/2012/03/generating_urls_whenever_and_wherever_you_want/
## Class
class Router
include Rails.application.routes.url_helpers
def self.default_url_options
ActionMailer::Base.default_url_options
end
end
View rails-install-ubuntu.sh
set -e
echo "Updates packages. Asks for your password."
sudo apt-get update -y
echo "Installs packages. Give your password when asked."
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev nodejs -y
echo "Installs ImageMagick for image processing"
sudo apt-get install imagemagick --fix-missing -y
View gist:538407
require "rubygems"
require "nokogiri"
require "uri"
module Rack
class KarmaChameleon
def initialize(app, options = {})
@ext = options[:extension] || "html5"
@ext_regexp = /\.#@ext$/
@app = app
View downloads_controller.rb
class DownloadsController < ApplicationController
def show
if @current_user
send_file "#{Rails.root}/downloads/test.pdf"
else
head(:not_found)
end
end
end
View gemspec
#!/usr/bin/env ruby
# Usage: gemspec [-s] GEMNAME
#
# Prints a basic gemspec for GEMNAME based on your git-config info.
# If -s is passed, saves it as a GEMNAME.gemspec in the current
# directory. Otherwise prints to standard output.
#
# Once you check this gemspec into your project, releasing a new gem
# is dead simple:
#
Something went wrong with that request. Please try again.