Skip to content

Instantly share code, notes, and snippets.

View vincentpaca's full-sized avatar

Vincent Paca vincentpaca

View GitHub Profile
@vincentpaca
vincentpaca / partner_form.json
Last active January 31, 2020 08:07
FE Take Home: JSON Form Builder
{
"components": [
{
"component_type": "text",
"name": "First Name",
"data": {}
},
{
"component_type": "text",
"name": "Last Name",
@vincentpaca
vincentpaca / s3_concat.rb
Last active January 21, 2016 06:07
S3 concat
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 October 6, 2015 09:28
s3_puts_file.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 August 29, 2015 14:06
Deis wrong ruby versions
> 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 August 29, 2015 14:05
Deis and Google Cloud Compute Engine integration

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 December 17, 2015 03:48
RVM, Ruby and Rails on Ubuntu

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 December 15, 2015 07:49
RVM, Ruby and Rails on OSX

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 February 10, 2012 17:45
Autotest & Notifications in Ubuntu
gem install autotest
gem install autotest-rails-pure
gem install autotest-notification
apt-get install libnotify-bin
@vincentpaca
vincentpaca / gist:1780816
Created February 9, 2012 16:02
Textmate + GEdit = GMate on Ubuntu, Ruby on Rails Text Editor
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
@vincentpaca
vincentpaca / gist:1696052
Created January 28, 2012 22:41
Bitly test
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>