Skip to content

Instantly share code, notes, and snippets.

Nick Newell blotto

  • KillerGeeks
Block or report user

Report or block blotto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@blotto
blotto / IronMQ example1
Last active Aug 29, 2015
IronMQ example
View IronMQ example1
function postTerm(term) {
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
var data = {
"messages": [
{
"body": term
}
@blotto
blotto / gist:8005531b9c94f3732240
Last active Aug 29, 2015
Sample Unicorn.rb File
View gist:8005531b9c94f3732240
#see https://devcenter.heroku.com/articles/rails-unicorn#the-unicorn-server
worker_processes ENV['WEB_CONCURRENCY'].to_i > 0 ? ENV['WEB_CONCURRENCY'].to_i : 3
timeout ENV['REQUEST_TIMEOUT'].to_i > 0 ? ENV['REQUEST_TIMEOUT'].to_i : 15
preload_app true
before_fork do |server, worker|
Signal.trap 'TERM' do
puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
@blotto
blotto / cleaners.rb
Created Apr 9, 2014
Some Sidekiq helper methods
View cleaners.rb
module AsyncTools
module Cleaners
def self.find_job_for_object_by_method(klass, method)
jobs = Sidekiq::ScheduledSet.new
jobs.select { |job|
@blotto
blotto / deploy
Created Jan 27, 2014
CI Deploy to Heroku
View deploy
#one off to ensure heroku remote is added to repo
heroku git:remote -a myApp
git remote add heroku git@heroku.com:myApp.git
#disables
curl https://heroku.newrelic.com/accounts/ACCTID/applications/APPID/ping_targets/disable -X POST -H "X-Api-Key: APIKEY"
heroku maintenance:on --app myApp
#push to heroku
git push --force heroku master
heroku run rake db:migrate --app myApp
#enables
View urbanspoon_reservations.rb
require 'rubygems'
require 'mechanize'
FIRST_NAME = 'FIRST_NAME'
LAST_NAME = 'LAST_NAME'
PHONE = 'PHONE'
EMAIL = 'EMAIL@provider.com'
PARTY_SIZE = 2
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' }
@blotto
blotto / set_jenkins_permGen_heapSize
Created Feb 26, 2013
increase permGen heapSize for Jenkins on MacOSx
View set_jenkins_permGen_heapSize
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
sudo touch /Library/Preferences/org.jenkins-ci
sudo defaults write /Library/Preferences/org.jenkins-ci permGen 512m
sudo defaults write /Library/Preferences/org.jenkins-ci heapSize 2048m
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
You can’t perform that action at this time.