Skip to content

Instantly share code, notes, and snippets.

View ngsmrk's full-sized avatar

Angus Mark ngsmrk

  • London
  • 11:24 (UTC +01:00)
View GitHub Profile
@ngsmrk
ngsmrk / sidekiq_monitoring
Created August 11, 2014 11:51
Sidekiq queue checking via rails console
stats = Sidekiq::Stats.new
stats.queues
stats.enqueued
stats.processed
stats.failed
@ngsmrk
ngsmrk / gist:5420492
Created April 19, 2013 13:51
Remove all gems
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
@ngsmrk
ngsmrk / gist:4365723
Created December 23, 2012 20:08
Brakeman in Rakefile
task :default do
Brakeman.run :app_path => ".", :print_report => true
end
@ngsmrk
ngsmrk / gist:4364436
Created December 23, 2012 17:03
Running brakeman
# run and put output to console
bundle exec rake brakeman:run
# run and save output as HTML to doc/report.html
bundle exec rake brakeman:run[doc/report.html]
@ngsmrk
ngsmrk / gist:4364392
Created December 23, 2012 17:00
Brakeman setup
# add this to your gemfile in your :development group
gem 'brakeman'
bundle
bundle exec brakeman --rake
@ngsmrk
ngsmrk / gist:4267500
Created December 12, 2012 12:55
Get details of heroku apps
heroku apps
heroku apps:info --app <app_name>
@ngsmrk
ngsmrk / gist:4267479
Created December 12, 2012 12:48
Add remote for heroku
git remote add heroku git@heroku.com:<app_name>.git
@ngsmrk
ngsmrk / gist:4260341
Created December 11, 2012 17:06
Sample travis CI YML file
language: ruby
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
# uncomment this line if your project needs to run something other than `rake`:
script: bundle exec rspec spec
@ngsmrk
ngsmrk / gist:2767770
Created May 22, 2012 09:15
How to config rspec so that view, helper and router specs are not generated when you generate controllers (and factory girl factories are)
In config/application.rb add the following inside the 'class Application < Rails::Application' block
config.generators do | g |
g.test_framework :rspec,
:fixtures => true,
:view_specs => false,
:helper_specs => false,
:routing_specs => false,
:controller_specs => true,
:request_specs => true
@ngsmrk
ngsmrk / gist:00c9486931834d8e8e1b
Created February 19, 2015 21:57
Clojure -> import, instantiate and call java.util.Random
(import '(java.util Random)
(def rnd (new Random))
(. rnd nextInt)