Skip to content

Instantly share code, notes, and snippets.

View keithcelt's full-sized avatar

Keith Swallow keithcelt

  • Los Angeles, CA
View GitHub Profile
@keithcelt
keithcelt / ar_sql_console.rb
Created January 21, 2016 19:36
AR SQL in IRB/PRY
ActiveRecord::Base.logger = Logger.new(STDOUT)
# formatting for copypasta
@ryansobol
ryansobol / gist:5252653
Last active November 22, 2023 11:53
15 Questions to Ask During a Ruby Interview

Originally published in June 2008

When hiring Ruby on Rails programmers, knowing the right questions to ask during an interview was a real challenge for me at first. In 30 minutes or less, it's difficult to get a solid read on a candidate's skill set without looking at code they've previously written. And in the corporate/enterprise world, I often don't have access to their previous work.

To ensure we hired competent ruby developers at my last job, I created a list of 15 ruby questions -- a ruby measuring stick if you will -- to select the cream of the crop that walked through our doors.

What to expect

Candidates will typically give you a range of responses based on their experience and personality. So it's up to you to decide the correctness of their answer.

@p1nox
p1nox / postgresql_configuration_on_ubuntu_for_rails.md
Last active November 29, 2023 04:38
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@tarcieri
tarcieri / pmap.rb
Created May 10, 2011 01:48
Simple parallel map using threads
module Enumerable
def pmap
threads = map do |elem|
Thread.new { yield elem }
end
threads.map { |thread| thread.join.value }
end
end
# Example MySQL config file for very large systems.
#
# This is for a large system with memory of 1G-2G where the system runs mainly
# MySQL.
#
# You can copy this file to
# /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options (in this
# installation this directory is /usr/local/var/mysql) or
# ~/.my.cnf to set user-specific options.