Skip to content

Instantly share code, notes, and snippets.

View rianrainey's full-sized avatar

Rian Rainey rianrainey

View GitHub Profile
@rianrainey
rianrainey / instructions.md
Created October 14, 2014 14:06
Set up Amazon S3 for Paperclip on Heroku
# Amazon S3 settings for Paperclip uploads
  config.paperclip_defaults = {
    :storage => :s3,
    :s3_protocol => 'https',
    :s3_credentials => {
    :bucket => ENV['AWS_BUCKET'],
    :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
    :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
 }
@rianrainey
rianrainey / yosemite-dev-solutions.md
Last active August 29, 2015 14:08
Solutions to problems encountered after upgrading to Yosemite on my development machine

Development Environment Solutions After Yosemite Upgrade

Can't start rails -s

  • I was missing minitest. By running gem install rails, it installed missing dependencies and thus fixed the minitest error. reference

  • Can't initialize': could not connect to server: Connection refused (PG::Error) reference

cd /usr/local/var/postgres
mkdir pg_tblspc pg_twophase pg_stat_tmp
pgstop
@rianrainey
rianrainey / change_url.sql
Created February 17, 2015 21:11
Update Wordpress URL in database via sql commands
UPDATE wp_options SET option_value = replace(option_value, 'http://dev-families-connect.pantheon.io', 'http://lvh.me:8000') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, 'http://dev-families-connect.pantheon.io','http://lvh.me:8000');
UPDATE wp_posts SET post_content = replace(post_content, 'http://dev-families-connect.pantheon.io', 'http://lvh.me:8000');
UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://dev-families-connect.pantheon.io','http://lvh.me:8000');
@rianrainey
rianrainey / PipeOperator.md
Last active August 29, 2015 14:26
Intro To Elixir
people = DB.find_customers 
orders = Orders.for_customers(people) 
tax = sales_tax(orders, 2013) 
filing = prepare_filing(tax)
filing = prepare_filing(sales_tax(Orders.for_customers(DB.find_customers), 2013))
@rianrainey
rianrainey / keybase.md
Created May 4, 2016 20:55
Keybase verification

Keybase proof

I hereby claim:

  • I am rianrainey on github.
  • I am rianrainey (https://keybase.io/rianrainey) on keybase.
  • I have a public key whose fingerprint is FFE1 CB9B 7E14 89A2 B0BD 87B9 43C0 0C1B 61E1 7CCA

To claim this, I am signing this object:

require: rubocop-rspec
#inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- bin/**/*
- db/**/*
- script/**/*
- vendor/**/*
@rianrainey
rianrainey / download_das.rb
Created April 3, 2018 19:37
Download DAS
#! /usr/bin/env ruby
require 'mechanize'
agent = Mechanize.new
agent.pluggable_parser.default = Mechanize::Download
agent.get 'https://www.destroyallsoftware.com/screencasts/catalog'
episodes = agent.page.search('.episode > a').map { |a| a['href'] }