Skip to content

Instantly share code, notes, and snippets.

Avatar

Rian Rainey rianrainey

View GitHub Profile
View download_das.rb
#! /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'] }
View .rubocop.yml
require: rubocop-rspec
#inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- bin/**/*
- db/**/*
- script/**/*
- vendor/**/*
@rianrainey
rianrainey / keybase.md
Created May 4, 2016
Keybase verification
View keybase.md

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:

@rianrainey
rianrainey / PipeOperator.md
Last active Aug 29, 2015
Intro To Elixir
View PipeOperator.md
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 / change_url.sql
Created Feb 17, 2015
Update Wordpress URL in database via sql commands
View change_url.sql
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 / yosemite-dev-solutions.md
Last active Aug 29, 2015
Solutions to problems encountered after upgrading to Yosemite on my development machine
View yosemite-dev-solutions.md

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 / instructions.md
Created Oct 14, 2014
Set up Amazon S3 for Paperclip on Heroku
View instructions.md
# 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']
  }
View spotify.scpt
if application "Spotify" is running then
tell application "Spotify" to playpause
else if application "iTunes" is running then
tell application "iTunes" to playpause
end if
if application "Spotify" is running then
tell application "Spotify" to next track
else if application "iTunes" is running then
tell application "iTunes" to next track
@rianrainey
rianrainey / submission.txt
Created Aug 28, 2014
s3auth.com example submission
View submission.txt
Host Name: goliath.example.com
AWS Key: 0123
AWS Secret Key: 3210
Bucket Name: goliath.example.com
Optional AWS S3 endpoint: I left it as the default of ‘s3’
Optional syslog UDP end-point: I left it as the default of ‘syslog.s3auth.com:514`.
@rianrainey
rianrainey / user-policy.json
Created Aug 28, 2014
AWS IAM User Policy for S3Auth
View user-policy.json
{ "Statement": [
{ "Effect": "Allow",
"Action": ["s3:GetObject", "s3:GetBucketWebsite"],
"Resource": [ "arn:aws:s3:::goliath.example.com/*" ]
}
]}
You can’t perform that action at this time.