View ruby_test_config.json
1 2 3 4 5 6 7 8 9
{
"erb_verify_command": "erb -xT - {file_name} | ruby -c",
"ruby_verify_command": "ruby -c {file_name}",
 
"run_ruby_unit_command": "ruby -Itest {relative_path}",
"run_single_ruby_unit_command": "ruby -Itest {relative_path} -n '{test_name}'",
 
"run_cucumber_command": "cucumber {relative_path}",
"run_single_cucumber_command": "cucumber {relative_path} -l{line_number}",
View hash_reducer.rb
1 2 3 4 5 6 7 8 9 10
module HashReducer
# use the block to transform the addition/reduce result for each value
def self.reduce!(base: nil, add: nil, &block)
base = {} unless base
add = {} unless add
fail 'base: must be a hash!' unless base.is_a?(Hash)
fail 'add: must be a hash!' unless add.is_a?(Hash)
add.each do |k,v|
if v.is_a?(Hash)
base[k] = {} unless base[k]
View gist:0402601d485e32c809fc
1 2 3 4 5 6 7 8 9 10
/var/folders/q8/p7npkjgn17d5m_7f1rdhnkww0000gn/T/ruby-build.20141121115309.41710 /usr/local/Cellar/ruby-build/20141113/share/ruby-build
/var/folders/q8/p7npkjgn17d5m_7f1rdhnkww0000gn/T/ruby-build.20141121115309.41710/rubinius-2.3.0 /var/folders/q8/p7npkjgn17d5m_7f1rdhnkww0000gn/T/ruby-build.20141121115309.41710 /usr/local/Cellar/ruby-build/20141113/share/ruby-build
Fetching gem metadata from https://rubygems.org/..
Installing rake 10.3.2
Installing daedalus-core 0.1.0
Installing redcard 1.1.0
Installing rubinius-ast 2.2.5
Installing rubinius-bridge 1.1.0
Installing rubinius-compiler 2.2.1
Installing rubinius-melbourne 2.2.2.0
View binary_tree.rb
1 2 3 4 5 6 7 8 9 10
# https://zvkemp.github.io/blog/2014/04/25/binary-search-trees-in-ruby/
 
module BinaryTree
class EmptyNode
def to_a
[]
end
 
def include?(*)
false
View ruby-recursive-build.rb
1 2 3 4 5 6 7 8 9 10
#!/usr/bin/env ruby
# Ruby Recursive Build
# This script is intended for environment first setups automation, its homebrewed and tested only on my env.
# Use it at your own risk.
# I strongly recommend you to read the code through, and change it to fit your needs.
# It will look for your .ruby-version files and install all of 'em
# run this inside your Workspace folder
 
# Download it into your Workspace folder
# chmod +x ruby-recursive-building.rb
View gist:8690171
1
heroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-ruby.git#v84 --app YOURAPP
View atualizando_ssl_heroku.md

(check the en_US version here)

Gerando um novo cert. SSL e atualizando no Heroku

Para gerar um novo certificado SSL você precisa dos seguintes procedimentos:

  • @dev Gerar um .CSR (é um arquivo texto com uma chave);
  • @dev Enviar o .CSR para a entidade certificadora (TheSSLstore);
    • @dev Verificar o Ownership do domínio via email (também da pra colocar um arquivo no srv. http);
    • @dev Baixar o .CRT (vem um zip com vários .CRT);
  • @dev Criar o bundle.crt
View updating_heroku_ssl.md

(check the pt_BR version here)

Updating your Heroku SSL certificate

To generate the new SSL you need to follow these steps:

  • @dev Generate a .CSR (a key text file);
  • @dev Send the .CSR to your certificate authority (We use TheSSLstore);
    • @dev Verify the domain ownership through email (you can also put a file at your http server);
    • @dev Download the .CRT file (probably a zipball with a bunch of .CRT files);
  • @dev Brew the bundle.crt
View dtrace_tips.md
View reports.rake
1 2 3 4 5 6 7 8 9 10
#@author: Lucas Martins
 
namespace :report do
desc 'Reports remaining time of tasks under work'
task :remaining => :environment do
data = []
Issue.find(:all, :conditions => ['status_id in (?)', [2,4] ],:order=>'id').each do |issue|
remaining = issue.estimated_hours-issue.spent_hours
puts "##{issue.id} '#{issue.subject}' => remaining: #{remaining}, spent: #{issue.spent_hours}, estimated: #{issue.estimated_hours}"
subtasks = []
Something went wrong with that request. Please try again.