Skip to content

Instantly share code, notes, and snippets.

View lucasmartins's full-sized avatar
🤘

Lucas Neves Martins lucasmartins

🤘
View GitHub Profile
@hnagato
hnagato / brew-rbenv-2012-03-01.sh
Created March 1, 2012 09:14
Install ruby with homebrew, rbenv and ruby-build on OSX 10.7
# Install rbenv, ruby-build and readline
brew install rbenv ruby-build readline
brew link readline
# Add rbenv init to .zshenv
cat <<-EOF | ruby -pe 'gsub("\\", "")' >> .zshenv
# rbenv
if which rbenv >/dev/null 2>&1; then
eval "$\(rbenv init -\)"
source /usr/local/Cellar/rbenv/0.3.0/completions/rbenv.zsh
@oestrich
oestrich / Gemfile
Created September 5, 2012 15:37
WebMachine Test
source :rubygems
gem 'webmachine'
gem 'rspec'
gem 'rspec_api_documentation'
gem 'rack-test'
gem 'json_spec'
@fellix
fellix / gist:3643749
Created September 5, 2012 20:07
Receita de pao de queijo
3 ovos
3 xícaras de polvilho (preferencia azedo, mas pode usar o doce também)
1 xícara de azeite
100g de queijo (qualquer um)
sal a gosto.
bata no liquidificador tudo, despeje em formas de empadinha coloque assar no forno, espere dourar, e pronto.
@antonio
antonio / fix_asset_not_precompiled_error.rb
Created November 19, 2012 16:14
Avoid Sprockets::Helpers::RailsHelper::AssetPaths::AssetNotPrecompiledError
# This file monkey patches the Rails include helpers to prevent them from
# failing with an AssetNotPrecompiled error. This should be fixed in
# Rails 4.x and by then we should delete this file
module Sprockets
module Helpers
module RailsHelper
alias_method :original_stylesheet_link_tag, :stylesheet_link_tag
alias_method :original_javascript_include_tag, :javascript_include_tag
alias_method :original_image_path, :image_path
@wolfeidau
wolfeidau / ruby2dtrace.md
Last active December 14, 2015 02:09
How to install ruby-2.0.0-p0 into rbenv with dtrace support

The aim of this post is to guide the reader through the process of installing ruby 2.0.0 into rbenv with dtrace probes enabled. As rbenv uses ruby-build, which currently downloads and compiles a copy of openssl rather than using the one maintained and updated in homebrew i prefer to use the homebrew one.

Note that you MUST install xcode before installing anything, then install homebrew, and lastly install openssl, via homebrew as follows.

brew install openssl

Next to overcome the fact that OSX doesn't have an openssl ca certificate bundle, use the following brew to create and maintain one using the CA certs stored in your keychain.

@bradhe
bradhe / heroku_rell_test.sh
Last active December 15, 2015 19:49
Results of ab against ruby 2.0 + reel + Heroku #disappointed
brad@/www/reel_test [master] $ heroku scale web=40
Scaling web processes... done, now running 40
brad@/www/reel_test [master] $ ab -c 1 -n 100 http://reel-test.herokuapp.com/
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking reel-test.herokuapp.com (be patient).....done
@lucasmartins
lucasmartins / updating_heroku_ssl.md
Last active December 20, 2015 03:59
Updating your Heroku SSL certificate

(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
@mislav
mislav / index.haml
Created March 21, 2011 15:00
How to render Haml, Erb templates with a layout
%h1&= title
%p Hello world
@rcrowley
rcrowley / multio.rb
Created July 28, 2010 06:15
Ruby IO multiplexer
# MultIO Ruby IO multiplexer
# http://rcrowley.org/2010/07/27/multio-ruby-io-multiplexer.html
require 'stringio'
class MultIO < Array
def <<(io)
if io.respond_to?(:to_str)
io = StringIO.new(io)
@markmeeus
markmeeus / gist:6412088
Last active August 31, 2017 12:28
A patch to reuse Moped connections in Mongoid inside Celluliod Actors. If you use Sidekiq with loads of work, you may want reuse your connections. Do not use this toghether with kiqstand as they try to achieve opposite results.
module Celluloid
class Thread < ::Thread
def []= key, value
if key_on_thread? key
thread_vars[key] = value
else
super
end
end