Skip to content

Instantly share code, notes, and snippets.

@arches
arches / gist:9256285
Created February 27, 2014 18:39
batch upload to s3
require 'rubygems'
require 'aws/s3'
local_file = ARGV[0]
guid = ARGV[1]
bucket = ARGV[2]
mime_type = ARGV[3]
AWS::S3::Base.establish_connection!(
:access_key_id => 'AKJAFLWEAJFLAKJ',
@arches
arches / abstract.markdown
Last active August 29, 2015 13:57
The Rails Console - A Comprehensive Introduction

Working on a Rails app without using the console is like flying a 747 without instruments. You can see where you're going if it's nice out but hit some bad weather and you're lost in the dark. In this talk I'll teach you the battle-tested console commands and techniques I use on a daily basis. We'll be spiking features, databasing, patching production apps, automating grunt work - the sky's the limit. You will leave with a firm command of the console and its role in your workflow.

### Keybase proof
I hereby claim:
* I am arches on github.
* I am arches (https://keybase.io/arches) on keybase.
* I have a public key whose fingerprint is 1A0B 41C3 670F 854E 13BA FF5F 95AC 08C2 A2B9 C6CD
To claim this, I am signing this object:
@arches
arches / req.txt
Last active August 29, 2015 14:17
PrettyQuick - Mobile Developer (iOS)
PrettyQuick - Mobile Developer (iOS)
## What We're Doing
PrettyQuick is the easiest way to book beauty services. We allow our users to book beauty appointments directly from their browser or smartphone. We pride ourselves on providing trusted recommendations and an excellent customer experience. Headquartered in Chicago, we're currently live in six cities and adding new partner salons every day.
We're solving a challenging problem: seamlessly matching supply and demand in a highly fragmented $60 billion industry. We're laser-focused on a technology-centric strategy and we need your help to make it happen.
## Why We're Hiring
@arches
arches / bundler.txt
Created July 15, 2015 16:03
what's wrong with my deps?
Bundler could not find compatible versions for gem "rest-client":
In snapshot (Gemfile.lock):
rest-client (= 1.8.0)
In Gemfile:
stripe (~> 1.17) ruby depends on
rest-client (~> 1.4) ruby
cloudinary (= 1.0.60) ruby depends on
rest-client (>= 0) ruby
@arches
arches / unified social media access
Created March 5, 2011 03:53
console output showing unified access to multiple 3rd-party services. In the output, we see my personal albums/images from these services.
>> albums = Album.find(user, {:services => [:flickr, :facebook]})
=> [#<Buffet::Album:0x1024deee8 @remote_id="72157625131396492", @title="set2", @service="flickr">,
#<Buffet::Album:0x1024df1e0 @remote_id="72157625006674119", @title="set1", @service="flickr">,
#<Buffet::Album:0x1024deec0 @title="Photostream", @service="flickr">,
#<Buffet::Album:0x1024d4330 @remote_id="505294201356", @title="Christmas 2010", @service="facebook">,
#<Buffet::Album:0x1024d4380 @remote_id="504864193096", @title="Profile Pictures", @service="facebook">,
#<Buffet::Album:0x1024d4358 @remote_id="504697162826", @title="A Retrospective", @service="facebook">,
.
.
.
@arches
arches / pre-commit-jammit
Created October 31, 2011 19:48
Git commit hook to package assets using Jammit
#!/bin/bash
# to install, replace your .git/hooks/pre-commit with this file
if [ $staged_asset_count -gt 0 ]; then
if [ $changed_asset_count -eq 0 ]; then
echo "Packaging css/js assets with jammit..."
jammit -f
git add public/packaged # you might need to change this based on the package_path you use in your assets.yml
else
@arches
arches / app.rb
Created February 13, 2012 00:57
News articles with voting
# Entities
class Post
attr_accessor :id, :title, :link, :summary
attr_accessor :reactions
def score
self.reactions.inject(0){|r, sum| sum += r.score }
end
end
@arches
arches / namespace.js
Created March 4, 2012 23:39
Namespacing syntax
var Foo; if (!Foo) Foo = {};
// Then you can safely define things on Foobar:
Foo.Bar = function(){};
@arches
arches / run_bot.rb
Created March 17, 2012 19:24
Chat client for dogs
require 'iron_mq'
# IronMQ credentials
token = asdf
project_id = asdf
# each chatter needs their own queue
@fido = IronMQ::Client.new('token' => token, 'project_id' => project_id, :queue_name => "fido")
@red_rover = IronMQ::Client.new('token' => token, 'project_id' => project_id, :queue_name => "red_rover")