Skip to content

Instantly share code, notes, and snippets.

View smarquezs's full-sized avatar
🏠
Working from home

Sergio Márquez smarquezs

🏠
Working from home
View GitHub Profile
@konklone
konklone / Dockerfile
Created September 22, 2013 18:17
Dockerfile for installing Ruby 2.0 and RVM
FROM ubuntu
MAINTAINER Eric Mill "eric@konklone.com"
# turn on universe packages
RUN echo "deb http://archive.ubuntu.com/ubuntu raring main universe" > /etc/apt/sources.list
RUN apt-get update
# basics
RUN apt-get install -y nginx openssh-server git-core openssh-client curl
RUN apt-get install -y nano
@sporkd
sporkd / question.rb
Created February 15, 2012 23:33
Using arel matches_any
class Question < ActiveRecord::Base
# UGLY
def self.starts_with(*strings)
# Big loop to build something like this...
where("wording LIKE ? OR wording LIKE ? OR wording LIKE ?", 'blah%', 'blaah%', 'blaaah%')
end
# PURDY
def self.starts_with(*strings)
strings = strings.map { |s| s+'%' }