Skip to content

Instantly share code, notes, and snippets.

View jcstringer's full-sized avatar

Jon Stringer jcstringer

View GitHub Profile
Nate Berkopec nate.berkopec@speedshop.co via mailchimpapp.net
8:41 AM (7 minutes ago)
to me
Hello Rubyists!
I'm experimenting with some additional email-only content this year, as a small thank you for subscribing to this list. To start with, I'm doing a many-part series on Sidekiq. This will be based on all the lessons I've learned over the years and applied with my clients.
Most of us are now using Sidekiq to run our background jobs. It's a big step up in throughput from single-threaded job processors, like Resque, and it's a big scalability boost over SQL-backed queues like DelayedJob. However, over the years, Sidekiq has exposed a few problems in the C-Ruby implementation related to threads, specifically around memory and the GVL (Global VM Lock). As a result, we've "learned" a lot about deploying Sidekiq in production since its 1.0 release.
<div class="field">
<label>Street Address</label>
<input type="text" name="street_address" value="" />
</div>
* executing `production'
* executing `deploy'
triggering before callbacks for `deploy'
* executing `set_branch'
(Tag|Branch|Commit) to deploy [v5.0.8]:
* executing `campfire:message:start'
* executing "git ls-remote git@github.com:g5search/core.git v5.0.8"
servers: ["72.46.233.151"]
[72.46.233.151:7004] executing command
command finished in 3566ms
@jcstringer
jcstringer / gist:2713960
Created May 16, 2012 21:07
Mysql upgrade punchlist
BEFORE MIGRATION
* Disable siteuptime
* Disable pagerduty alerting
* Disable scout alerting for mysql slices
* Comment out any cron jobs on util slice that would run during the migration
* Pause or comment out any cron or resque scheduler tasks on jobs slice that would run during the migration
* Pause paid campaigns
* bundle exec cap production deploy:web:disable to throw up maintenance page
* Disable API
store.on({'loadexception':{
fn: function(httpProxy, dataObject, arguments, exception){
console.log('** - Data Store listener fired (loadexception), arguments:',arguments);
console.log('** - Data Store listener fired (loadexception), exception:',exception);
}
,scope:this
}
});
new Date ( Date.parse("2011/11/23") )
=> Wed Nov 23 2011 00:00:00 GMT-0800 (PST)
new Date ( Date.parse("11/23/2011") )
=> Wed Nov 23 2011 00:00:00 GMT-0800 (PST)
new Date ( Date.parse("11-23-2011") )
=> Wed Nov 23 2011 00:00:00 GMT-0800 (PST)
## This is weird! ##
def logo(options={})
options.reverse_merge!({:category => "logo", :id => "logo", :alt => @store.branded_name, :link_title => @store.branded_name})
return "" unless @store
logo_img = ""
if logo_asset = @store.attachments.find_by_category(options[:category])
logo_img += image_tag(logo_asset.url, {:id => options[:id], :alt => options[:alt]})
elsif @store.logo?
logo_img += image_tag(@store.logo.url, {:id => options[:id], :alt => options[:alt]})
end
controller.action_name.eql?('index') ? logo_img : link_to(logo_img, "/", :title => options[:link_title])
%figure
= mobile_store_photo_image_tag(@store)
.contact
.nav_aid.adr.centered.vcard
<<<<<<< HEAD
%h1.nav_aid
=@store.keyword_text.titleize
in
=@store.city
=======
Chris-Stringers-MacBook-Pro:core chrisstringer$ ls -la public/fragments/
total 0
drwxr-xr-x 125 chrisstringer staff 4250 May 27 12:28 .
drwxr-xr-x 29 chrisstringer staff 986 May 18 17:09 ..
drwxr-xr-x 3 chrisstringer staff 102 May 23 13:55 43A
drwxr-xr-x 3 chrisstringer staff 102 May 23 13:54 43B
drwxr-xr-x 3 chrisstringer staff 102 May 23 13:55 43C
drwxr-xr-x 3 chrisstringer staff 102 May 23 13:55 43D
drwxr-xr-x 3 chrisstringer staff 102 May 23 13:55 43E
drwxr-xr-x 3 chrisstringer staff 102 May 23 13:55 43F
Using mysql (2.8.1)
/usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_input.rb:52:in `initialize': not in gzip format (Zlib::GzipFile::Error)
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_input.rb:52:in `new'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_input.rb:52:in `initialize'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_reader.rb:64:in `each'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `loop'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_reader.rb:55:in `each'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_input.rb:35:in `initialize'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_input.rb:20:in `new'
from /usr/lib64/rubyee/site_ruby/1.8/rubygems/package/tar_input.rb:20:in `open'