Skip to content

Instantly share code, notes, and snippets.

Vincent Paca vincentpaca

Block or report user

Report or block vincentpaca

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View s3_concat.rb
require 'aws-sdk'
s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])
rspec_bucket = s3.bucket(ENV['RSPEC_BUCKET'])
cukes_bucket = s3.bucket(ENV['CUKES_BUCKET'])
rspec_objects = rspec_bucket.objects(prefix: ENV['CI_BUILD_NUMBER'])
cukes_objects = cukes_bucket.objects(prefix: ENV['CI_BUILD_NUMBER'])
test_group_threshold = ENV['TEST_GROUPS'].to_i
@vincentpaca
vincentpaca / s3_upload.rb
Last active Oct 6, 2015
s3_puts_file.rb
View s3_upload.rb
require 'aws-sdk'
s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])
rspec_bucket = obj = s3.bucket(ENV['RSPEC_BUCKET']).object("#{ENV['CI_BUILD_NUMBER']}/#{ENV['TEST_GROUP']}")
cukes_bucket = obj = s3.bucket(ENV['CUKES_BUCKET']).object("#{ENV['CI_BUILD_NUMBER']}/#{ENV['TEST_GROUP']}")
log_files = [ENV['RSPEC_LOG_PATH'], ENV['CUCUMBER_LOG_PATH']]
log_files.each do |log_file|
bucket = log_file.include?("rspec") ? rspec_bucket : cukes_bucket
@vincentpaca
vincentpaca / deis_errors1
Last active Aug 29, 2015
Deis wrong ruby versions
View deis_errors1
> cat Gemfile
...
ruby '2.1.2'
...
> deis run 'ruby -v'
ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]
> deis run 'rake'
/bin/bash: rake: command not found
@vincentpaca
vincentpaca / deis_gce.md
Last active Aug 29, 2015
Deis and Google Cloud Compute Engine integration
View deis_gce.md

fleetctl v0.7.1 fleet v0.7.1 deis v0.11.0

Setting Up Google Cloud utilities

  1. Install the gcloud utility by running curl https://sdk.cloud.google.com | bash
  2. Follow the steps.
    • If using zsh, edit your .zshrc file near the bottom and find the lines that were added by the] gcloud util install. Replace path.bash.inc with path.zsh.inc, do the same with completion.
@vincentpaca
vincentpaca / rvm-rails-on-ubuntu.md
Last active Dec 17, 2015
RVM, Ruby and Rails on Ubuntu
View rvm-rails-on-ubuntu.md

RVM

Open terminal then run: sudo apt-get install curl

Install RVM with curl -L get.rvm.io | bash -s stable --auto

Reload bash with . ~/.bash_profile

Run: rvm requirements should be successful and give you a bunch of text

@vincentpaca
vincentpaca / rvm-rails-on-osx.md
Last active Dec 15, 2015
RVM, Ruby and Rails on OSX
View rvm-rails-on-osx.md

RVM, Ruby and Rails on OSX

  1. Download and install Xcode from the App Store.

  2. Download and install command line tools on Xcode. On the menu go to Preferences > Downloads > Install Command Line Tools

  3. Install homebrew like so:

     ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go)"
    
@vincentpaca
vincentpaca / gist:1791197
Created Feb 10, 2012
Autotest & Notifications in Ubuntu
View gist:1791197
gem install autotest
gem install autotest-rails-pure
gem install autotest-notification
apt-get install libnotify-bin
@vincentpaca
vincentpaca / gist:1780816
Created Feb 9, 2012
Textmate + GEdit = GMate on Ubuntu, Ruby on Rails Text Editor
View gist:1780816
sudo add-apt-repository ppa:ubuntu-on-rails/ppa
sudo apt-get update
sudo apt-get install gedit-gmate
sudo apt-get install gedit-plugins
View gist:1696052
1.9.3p0 :002 > BITLY_CLIENT
=> #<Bitly::V3::Client:0xb653398 @default_query_opts={:login=>"yourusername", :apiKey=>"yourkey"}>
1.9.3p0 :001 > BITLY_CLIENT.shorten("http://google.com")
=> #<Bitly::V3::Url:0xb5658c8 @client=#<Bitly::V3::Client:0xb653398 @default_query_opts={:login=>"yourusername", :apiKey=>"yourkey"}>, @short_url="http://bit.ly/xFMlrA", @long_url="http://google.com/", @user_hash="xFMlrA", @global_hash="LmvF", @new_hash=false, @user_clicks=nil, @global_clicks=nil, @title=nil, @created_by=nil, @aggregate_link=nil, @clicks_by_minute=nil>
@vincentpaca
vincentpaca / bitly.rb
Created Jan 28, 2012
Bitly initializer
View bitly.rb
require Rails.root.join('config','initializers','load_config')
Bitly.use_api_version_3
BITLY_CLIENT = Bitly.new(APP_CONFIG['bitly_username'], APP_CONFIG['bitly_key'])
You can’t perform that action at this time.