Skip to content

Instantly share code, notes, and snippets.

Tiago Scolari tscolari

Block or report user

Report or block tscolari

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
tscolari / hyperkube
Last active Aug 29, 2015
kubernetes 0.16.0
tscolari / shared_examples_default_crud_routing.rb
Created May 6, 2011
This is a set of tests for default CRUD routing in rails. Also works with namespaces.
View shared_examples_default_crud_routing.rb
shared_examples_for "default crud routing" do
let(:random_id_for_routing) {rand(2000)}
let(:controller_name) {described_class.to_s.underscore.gsub(/_controller/, '')}
it "should route to index action" do
{:get => "/#{controller_name}"}.should route_to(
:controller => controller_name,
:action => 'index'
tscolari / Gemfile
Created Aug 15, 2012
Octopress S3 Deploy Method
View Gemfile
# ....
gem 'aws-s3'
# ....
tscolari / s3_upload_files.rb
Created Aug 16, 2012
S3 multiple file uploader
View s3_upload_files.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'aws/s3'
# If you use a directory as parameter, every file inside it will be uploaded.
# ex: ./s3_upload_files /system/backups/
# If you use a text file as parameter, it should have one file name per line, all files listed will be uploaded.
# ex: ./s3_upload_files changeset
tscolari / factories_spec.rb
Last active Oct 9, 2015
Spec for all factories
View factories_spec.rb
require 'spec_helper'
describe FactoryGirl do
FactoryGirl.factories.each do |factory|
context "with factory for :#{}" do
subject {}
it "is valid" do
subject.valid?.should be, subject.errors.full_messages.join(',')
tscolari / vim.rb
Created Sep 26, 2012 — forked from bmatheny/vim.rb
Vim Formula with Ruby & Python support for OS X
View vim.rb
require 'formula'
class Vim < Formula
homepage ''
version '7.3.666'
url '', :revision => '1e22adc6176e'
head ''
def ruby_bin
tscolari / kd_tree.rb
Created Dec 14, 2012
Simple KDTree implementation to find the nearest point to another
View kd_tree.rb
# Simple KDTree class with sorting for finding nearest neighbor
class KDTree
class Node <, :left, :right)
# Public: Returns the distance of the object to the
# point
def distance_to(point)
throw "Points have different dimensions" if point.size != value.size
square_sum = 0
tscolari / rcodetools.vim
Last active Dec 19, 2015
rcodetools.vim to use with vundles source:
View rcodetools.vim
" Copyright (C) 2006 Mauricio Fernandez <>
" rcodetools support plugin
if exists("loaded_rcodetools")
let loaded_rcodetools = 1
let s:save_cpo = &cpo
tscolari /
Last active Dec 20, 2015
Commit with story id
  • add prepare-commit-msg it to ./.git/hooks/
  • Make it executable (chmod +x filename)

It should prepend [#STORY_ID] into your commit message when the editor pops up. Your branch must be in this format to work: branch-description-blabla-STORY_ID

it skips the prepaend if:

  • The branch doesn't end in a story id (integer)
  • The original commit message starts with "Merge"
tscolari /
Created Jul 26, 2013
Work in progress
  • Avoids files with debugger/binding.pry to be commited
  • Avoids files with spaces in the end of the line to be commited


  • Copy the file to .git/hooks/pre-commit
  • Make it executable chmod + x .git/hooks/pre-commit
  • Have fun
You can’t perform that action at this time.