Skip to content

Instantly share code, notes, and snippets.

@eparreno
eparreno / sidekiq_delete_jobs.md
Last active Sep 6, 2021
How to delete Sidekiq jobs in a Rails app using ActiveJobs
View sidekiq_delete_jobs.md

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 / gist:f5ebc58a24a73e85aac9
Last active Aug 29, 2015
Gibson Les Paul Supreme WR 2013
View gist:f5ebc58a24a73e85aac9
Awesome Gibson Les Paul Supreme 2013 Wine Red colour. AAAA maple top and back, gold hardware.
Pictures https://goo.gl/photos/GEzW8Gssib1RH5qc9
From Musicorp:
"This model bears all the hallmarks of an ornate custom-made instrument, with seven-ply top binding, three-ply back binding, a bound Richlite® fingerboard with mother-of-pearl (MoP) split-block inlays, a showpiece headstock trimmed in five-ply binding with deluxe MoP globe inlay and "Supreme" banner, MoP Gibson logo, an engraved brass truss-rod cover, gold hardware, and even gold-tinted frets. With gorgeous flamed maple on both sides of a chambered mahogany body core, the Les Paul Supreme is nothing short of stunning, and your choice of translucent high-gloss Heritage Cherry Burst or Desert Burst finish shows off this exalted wood with real class.
More than just an incredible looker, however, the Les Paul Supreme is also a powerful tone machine. A pair of Gibson's most popular humbucking pickups with genuine Alnico magnets yield a wide array of voices
@eparreno
eparreno / gist:2300165
Created Apr 4, 2012
About estimations
View gist:2300165
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 Mar 15, 2012
Deploy with Capistrano + Passenger + Bundle
View gist:2045638
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 / gist:1845561
Created Feb 16, 2012
Install libmagic on Mac OS X via homebrew
View gist:1845561
$ 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 / instructions.md
Created Feb 15, 2012 — forked from jodosha/instructions.md
How to install ruby-debug19 and linecache19 on 1.9.3-p0
View instructions.md
@eparreno
eparreno / gist:1099220
Created Jul 22, 2011
Curso introduccion a Rails en Barcelona (5-9 septiembre)
View gist:1099220
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 Mar 31, 2011
My TextMate File Pattern
View gist:896271
!(.\.sqlite3|/\.(?!htaccess)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$
@eparreno
eparreno / update_counters
Created Nov 10, 2010
Update counters rake task
View update_counters
task :update_counters => :environment do
Tag.reset_column_information
Tag.all.each do |t|
Tag.update_counters(t.id, :taggings_count => t.taggings.count)
end
end