Skip to content

Instantly share code, notes, and snippets.

View brycemcd's full-sized avatar

Bryce McDonnell brycemcd

View GitHub Profile
@brycemcd
brycemcd / foreign-data-wrapper.sql
Created July 2, 2013 15:23
Create a foreign data wrapper in postgres, add perms to user
-- AS ADMIN USER
-- create extension, server and fdw
CREATE EXTENSION mysql_fdw;
CREATE SERVER mysql_svr
FOREIGN DATA WRAPPER mysql_fdw
OPTIONS (address 'localhost', port '3306');
-- GRANTS
@brycemcd
brycemcd / perms.sql
Last active August 27, 2018 14:58
Postgres Role based permissions
-- create user:
CREATE COLE user_name LOGIN PASSWORD 'password' SUPERUSER;
-- create role:
CREATE ROLE overlord;
-- grant role to user:
GRANT overlord TO user_name;
-- Not very many privs
@brycemcd
brycemcd / Clymb-developer-business-intelligence.md
Created January 30, 2013 17:34
The Clymb is hiring a software developer in the business intelligence department!

Software Developer - Business Intelligence

Job Summary:

Innovation is our driving force at The Clymb, and a human-powered approach to creative technology and solutions is our passion. We’re seeking a software developer in our business intelligence (BI) division who will be instrumental in designing and implementing our data systems. This role will aggregate data from various sources to optimize our business intelligence in the form of efficient, functional systems. This is an opportunity to make a big impact by joining a high growth company early in its development.

@brycemcd
brycemcd / walkthrough.md
Created November 2, 2012 06:51
Terminal sorcery with tmux
@brycemcd
brycemcd / .vimrc
Created September 28, 2012 16:44
tmux and vim integration
" test the current file in the next tmux window
nmap <leader>tt :!tmux send-keys -t 1 "rspec %" C-m <cr>
" test the line from user input
nmap <leader>tl :!tmux send-keys -t 1 "rspec %:<C-r>=line('.')<cr>" C-m <cr>
@brycemcd
brycemcd / ex_workflow.txt
Created August 27, 2012 15:03
deploying tags
# Yesterday's deploy tag:
20120801
# See what's been merged today, what's about to deploy:
# https://github.com/TheClymb/theclymb/compare/20120801...HEAD
# Tag the current release for deploy:
@brycemcd
brycemcd / full_backtrace.txt
Created June 4, 2012 21:13
problem with interface between s3, vcr and paperclip
1) MasterAsset validations after_create should fill in sha with the SHA1 of the file and the url with the url
Failure/Error: mi.image = img
AWS::Errors::Base:
# /usr/local/rvm/gems/ruby-1.9.3-p125@theclymb3/gems/aws-sdk-1.3.3/lib/aws/core/client.rb:261:in `return_or_raise'
# /usr/local/rvm/gems/ruby-1.9.3-p125@theclymb3/gems/aws-sdk-1.3.3/lib/aws/core/client.rb:323:in `client_request'
# (eval):3:in `head_object'
# /usr/local/rvm/gems/ruby-1.9.3-p125@theclymb3/gems/aws-sdk-1.3.3/lib/aws/s3/s3_object.rb:94:in `head'
# /usr/local/rvm/gems/ruby-1.9.3-p125@theclymb3/gems/aws-sdk-1.3.3/lib/aws/s3/s3_object.rb:71:in `exists?'
# /usr/local/rvm/gems/ruby-1.9.3-p125@theclymb3/gems/paperclip-2.5.2/lib/paperclip/storage/s3.rb:237:in `exists?'
# /usr/local/rvm/gems/ruby-1.9.3-p125@theclymb3/gems/paperclip-2.5.2/lib/paperclip/attachment.rb:460:in `block in queue_existing_for_delete'
@brycemcd
brycemcd / executed_sql.sql
Created March 24, 2012 18:24
For increment/decrement blog post
BEGIN;
UPDATE inventories SET inventory_amount = 99;
COMMIT;
@brycemcd
brycemcd / vim.rc
Created December 21, 2011 20:40
my janice vimrc
" BAREBONES STUFF
" sanity things
set number
syntax on
"indent settings
set shiftwidth=2
set softtabstop=2
set expandtab
set autoindent
@brycemcd
brycemcd / style.rb
Created July 29, 2011 19:16
paperclip processors
has_attached_file :main, :styles => { :grid => "250x390>",
:detail => "400x600>",
:thumb => "75x75#",
:trans => { :processors => [:trans_to_dark] }
},
:default_url => "/images/missing.png",
:storage => :s3,
:s3_credentials => "#{RAILS_ROOT}/config/s3.yml",
:bucket => "mybuck",
:path => "product_images/:id/main/:style.:extension"