Skip to content

Instantly share code, notes, and snippets.

View gabeodess's full-sized avatar

Gabe Odess gabeodess

  • RigUp
  • Austin TX
  • 08:08 (UTC -05:00)
View GitHub Profile
$spring rake test test/integration/signup_test.rb
Run options: --seed 13906
# Running:
#(Element:0x3fe090fae7f8 {
name = "a",
attributes = [
#(Attr:0x3fe090fae014 {
name = "class",
$scope.$evalAsync(
function( ) {
$('body').append($('<div/>').html("{{coffee}}"))
}
);
@gabeodess
gabeodess / subscription.rb
Last active August 29, 2015 14:16
Stubbing #save! and raising an exception with Mocha
class Subscription < ActiveRecord::Base
PRICING = {
1 => {
:small => 1300,
:medium => 1900,
:large => 2400
}.with_indifferent_access,
2 => {
:small => 16500,
@gabeodess
gabeodess / redis-to-go.txt
Last active August 29, 2015 14:15
Sidekiq on Heroku
# = General ==================================================================
port 10081
databases 1
loglevel notice
logfile /mnt/redis.330229.log
# = Security =================================================================
requirepass xxx
@gabeodess
gabeodess / action_mailer.rb
Created February 3, 2015 05:43
Enabling ActionMailer previews in your production environment
# config/initializers/action_mailer.rb
class Rails::MailersController
protected
# The built in controller has a before_action call to :require_local! We override it here to enable use in production.
def require_local!
# I use the devise gem with active admin so I call authenticate_admin_user! so that only administrators are allowed to preview email templates.
@gabeodess
gabeodess / application_helper.rb
Last active August 29, 2015 14:10
A simple helper for debugging long running code.
# Usage:
# timestamp('some descriptive key') do
# sleep 20
# end
# => check your logs.
def timestamp(key, &block)
start = Time.now
yield
p ["custom-timestamp: #{key}", Time.now - start] if !Rails.env.test?
end
@gabeodess
gabeodess / mp4
Created November 5, 2014 23:32
ffmpeg for Web
$ffmpeg -i market2.mp4 -vcodec libx264 -acodec libfaac -s 640x360 -vb 872000 -an -profile main -pix_fmt yuv420p -movflags +faststart market-sd.mp4
ffmpeg version 2.2.3 Copyright (c) 2000-2014 the FFmpeg developers
built on Nov 4 2014 12:47:40 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libvpx
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
@gabeodess
gabeodess / not-working
Created November 5, 2014 23:22
ffprobe output
gabeodess@Gabriels-MacBook-Air-4:~/Desktop$ffprobe market-sd.mp4
ffprobe version 2.2.3 Copyright (c) 2007-2014 the FFmpeg developers
built on Nov 4 2014 12:47:40 with Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2.3 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid --enable-libvorbis --enable-libvpx
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
@gabeodess
gabeodess / Explanation
Created September 25, 2014 14:36
Thread:: superclass on my controller not found
When I visit "/queue/competitors" I get the following error:
uninitialized constant Thread::Queue::CompetitorsController
with a list of all my routes including this one:
queue_competitors_path GET /queue/competitors(.:format) queue/competitors#index
Started PUT "/merchant_center/deliveries/1287" for 127.0.0.1 at 2014-05-20 09:08:35 -0400
DEPRECATION WARNING: Database connections will not be closed automatically, please close your
database connection at the end of the thread by calling `close` on your
connection. For example: ActiveRecord::Base.connection.close
. (called from mon_synchronize at /Users/gabeodess/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/monitor.rb:211)
DEPRECATION WARNING: Database connections will not be closed automatically, please close your
database connection at the end of the thread by calling `close` on your
connection. For example: ActiveRecord::Base.connection.close
. (called from mon_synchronize at /Users/gabeodess/.rvm/rubies/ruby-1.9.3-p545/lib/ruby/1.9.1/monitor.rb:211)
DEPRECATION WARNING: Database connections will not be closed automatically, please close your