Skip to content

Instantly share code, notes, and snippets.

MONTH=`date +"%Y-%m"`
DAY=`date +"%d"`
THISHOUR=`date +"%H"`
TIMESTAMP=`date +"%Y-%m-%d"`
echo "Start: postgresql.log.${TIMESTAMP}"
ruckus / mailer_recipient_override.rb
Created September 9, 2016 21:40
Place in `config/initializers/mailer_recipient_override.rb` and be sure to define an environment variable for `EMAIL_RECIPIENT_OVERRIDE`
class OverrideMailReciptient
def self.delivering_email(mail)
if Rails.env.development?
mail.subject = "[DEVELOPMENT] #{mail.subject} - Recipient: #{original_to}"
if &&
new_body = "#{mail.body}\n\nRemoved CC: recipients: #{", ")}"
mail.body = new_body = []
TextView mDistributor;
TextView mStatus;
TextView mOrderDate;
TextView mPickupDate;
TextView mDeliveryDate;
ruckus / generate_butterknife_binds.rb
Created September 30, 2015 02:14
Auto-generate ButterKnife @Bind calls
require 'rubygems'
require 'nokogiri'
xml = Nokogiri::XML([0]))
class String
def camel_case
return self if self !~ /_/ && self =~ /[A-Z]+.*/
sheet.sheet_view do |sv|
sv.pane do |pane|
pane.top_left_cell = 'B1'
pane.state = :frozen
pane.x_split = 1
pane.active_pane = :top_right
<sheetView windowProtection="false" tabSelected="false" showWhiteSpace="false" showOutlineSymbols="false" showFormulas="false" rightToLeft="false" showZeros="true" showRuler="true" showRowColHeaders="true" showGridLines="true" defaultGridColor="true" zoomScale="100" workbookViewId="0" zoomScaleSheetLayoutView="0" zoomScalePageLayoutView="0" zoomScaleNormal="0">
<pane topLeftCell="B1" state="frozen" activePane="topRight" ySplit="0" xSplit="1"/>
ruckus / rds_download_logfiles.rb
Created January 9, 2015 03:58
Ruby script to download log files from RDS and archive to S3.
This script uses the AWS v2 API
source ""
gem "aws-sdk", "2.0.17.pre"
ruckus /
Created September 25, 2014 20:49
Example of using a ViewPager as a Header in a ListView. We need to explicitly set the layout params of the Header view because its not known at initialization time, in my case I am asynchronously loading images into the ViewPager.
public class ProductDetailActivity extends FragmentActivity {
protected void onCreate(Bundle savedInstanceState) {
final DisplayMetrics displayMetrics = new DisplayMetrics();
final int width = displayMetrics.widthPixels;
mListView = (ListView)findViewById(;

Keybase proof

I hereby claim:

  • I am ruckus on github.
  • I am toolbag ( on keybase.
  • I have a public key whose fingerprint is E0A2 B6E5 3211 66F3 C462 ADC6 90E5 F40B 708B A52A

To claim this, I am signing this object:

ruckus / gist:747c702d7ab7f4243c69
Created August 1, 2014 15:52
Sample result of QBO AgedReceivables report
"Header": {
"Time": "2014-07-01T08:51:36-07:00",
"ReportName": "AgedReceivables",
"StartPeriod": "2014-08-01",
"EndPeriod": "2014-08-01",
"Currency": "USD",
"Option": [
"Name": "report_date",