Skip to content

Instantly share code, notes, and snippets.

View bruchu's full-sized avatar

Bruce Chu bruchu

  • San Francisco, CA
View GitHub Profile
dbUrl = conf.mongo.oplogUrl || "mongodb://localhost:27017/local";
dbUrl = dbUrl + '?socketTimeoutMS=3000000'
query = {};
query = {$gte:MongoDB.Timestamp(Date.now()/1000 - 86400, 0)};
// query = {$gte:0};
console.log(query);
// dbUrl = 'mongodb://localhost:27017/local'
@bruchu
bruchu / gist:8230184
Last active June 14, 2016 13:33
change s3 content-type using aws ruby sdk
bash:
export AWS_ACCESS_KEY_ID='...'
export AWS_SECRET_ACCESS_KEY='...'
export AWS_REGION='us-east-1'
irb or ruby script:
require 'aws-sdk'
s3 = AWS::S3.new
## Get FFMpeg working on heroku by building binaries using vulcan
# also added instructions on how to compile with libmp3lame and libx264
gem install vulcan
vulcan create foo
#clone the app vulcan just created
git clone git@heroku.com:foo
@bruchu
bruchu / controller
Created October 8, 2013 19:15
Below changes go with https://github.com/bruchu/devise_invitable/commit/01190126128c3ad579a1a3c876c9ba341337c38c to be able to pass additional email context to devise_invitable :invitation_instructions. The changes will work with devise-async.
self.user = User.invite!({ :email => self.email, :invitation_context => { :message => self.message } }, self.inviting_user)