Skip to content

Instantly share code, notes, and snippets.

@eparreno
eparreno / gist:1845561
Created February 16, 2012 15:17
Install libmagic on Mac OS X via homebrew
$ brew install libmagic
$ brew link libmagic (if the link is already created is going to fail, don't worry about that)
$ env ARCHFLAGS="-arch x86_64" gem install ruby-filemagic -- --with-magic-include=/usr/local/include --with-magic-lib=/usr/local/lib/
@eparreno
eparreno / sidekiq_delete_jobs.md
Last active September 5, 2023 17:38
How to delete Sidekiq jobs in a Rails app using ActiveJobs

How to delete Sidekiq jobs in a Rails app using ActiveJobs

Sidekiq jobs can be enqueued or scheduled. Enqueued means that they are gonna be picked up as soon as possible, scheduled jobs will be enqueued at some specific time.

job_id and jid

When using ActiveJobs, Rails will return a job_id after sending the job to ActiveJobs

job = UserMailer.send_invite(params).deliver_later
@eparreno
eparreno / x-plane-addons.md
Last active April 13, 2020 18:51
X-Plane Addons
@eparreno
eparreno / iso countries list (csv)
Created October 9, 2009 10:07
iso countries list (csv)
"name","iso_name","iso2","iso3","numcode"
"Antigua and Barbuda","ANTIGUA AND BARBUDA","AG","ATG",28
"Bosnia and Herzegovina","BOSNIA AND HERZEGOVINA","BA","BIH",70
"Cocos (Keeling) Islands","COCOS (KEELING) ISLANDS","CC","\N","\N"
"Congo, the Democratic Republic of the","CONGO, THE DEMOCRATIC REPUBLIC OF THE","CD","COD",180
"Cote D'Ivoire","COTE D'IVOIRE","CI","CIV",384
"Fiji","FIJI","FJ","FJI",242
"French Southern Territories","FRENCH SOUTHERN TERRITORIES","TF","\N","\N"
"Heard Island and Mcdonald Islands","HEARD ISLAND AND MCDONALD ISLANDS","HM","\N","\N"
"Holy See (Vatican City State)","HOLY SEE (VATICAN CITY STATE)","VA","VAT",336
@eparreno
eparreno / RSpec - ActionMailer
Created July 7, 2010 05:54
RSpec ActionMailer test
# config/environments/test.rb
ActionMailer::Base.delivery_method = :test
# spec/models/mailer_spec.rb
describe Mailer do
before(:each) do
ActionMailer::Base.deliveries = []
end
it 'should send some random email' do
@eparreno
eparreno / gist:2300165
Created April 4, 2012 10:23
About estimations
P = programmer; NP = non-programmer
NP: How long will it take?
P: It'll take as long as it takes.
NP: I don't understand. What does that mean?
P: When you tell me that the product is finished, it's done.
NP: You mean you can't estimate how long it'll take?
P: I can't estimate when you'll decide that it is done, therefore an
accurate prediction is impossible. From experience I know that a
project like this can take from three to nine months. A lot
@eparreno
eparreno / gist:2045638
Created March 15, 2012 17:55
Deploy with Capistrano + Passenger + Bundle
require "bundler/capistrano"
set :application, "myapp"
set :keep_releases, 3
# Git settings
set :scm, :git
set :repository, 'git@github.com:my_github_user/my_app.git'
set :branch, 'master'
set :copy_strategy, :export
@eparreno
eparreno / instructions.md
Created February 15, 2012 13:21 — forked from jodosha/instructions.md
How to install ruby-debug19 and linecache19 on 1.9.3-p0
@eparreno
eparreno / gist:1099220
Created July 22, 2011 10:32
Curso introduccion a Rails en Barcelona (5-9 septiembre)
Más que un curso con clases magistrales es un taller, donde cada uno deberá venir con su portátil preparado para programar. Evidentemente habrá teoría per la intención del curso es, ademas de que salgáis con una base solida de Ruby y Rails, que aprendais a desenvolveros solos, que seáis autónomos y
sepáis donde buscar información, como aprender más cosas, incorporar nuevas librerías... En definitiva que después del curso seáis capaces de empezar una app e ir haciendolo cada vez mejor y con más funcionalidades.
Temario
Introducción a Ruby (5 horas)
1. Instalación de Ruby
2. Sintaxis básica de Ruby
3. Tipos de datos
4. Estructuras de control
5. Iteradores
@eparreno
eparreno / gist:896271
Created March 31, 2011 12:23
My TextMate File Pattern
!(.\.sqlite3|/\.(?!htaccess)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$