Skip to content

Instantly share code, notes, and snippets.

Carlos Souza caike

Block or report user

Report or block caike

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
guybrush /
Created May 6, 2011
a list of slides from nodeconf 2011
jswanner /
Created Aug 2, 2011
How to patch ruby for GC tuning and faster requiring
case "$rvm_ruby_string" in
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
jswanner / Gemfile.diff
Created Oct 7, 2011
Differences between Rails 3.1.0.rc4 & Rails 3.1.1 generated apps
View Gemfile.diff
diff -U 0 -r rails-3.1.0.rc4/Gemfile rails-3.1.1/Gemfile
--- rails-3.1.0.rc4/Gemfile 2011-10-07 12:02:26.000000000 -0400
+++ rails-3.1.1/Gemfile 2011-10-07 12:59:13.000000000 -0400
@@ -3 +3 @@
-gem 'rails', '3.1.0.rc4'
+gem 'rails', '3.1.1'
@@ -10,4 +10,8 @@
-# Asset template engines
-gem 'sass-rails', "~> 3.1.0.rc"
-gem 'coffee-script'
thermistor / assets.rake
Created Oct 20, 2011 — forked from shedd/assets.rake
Check asset encoding for valid UTF-8
View assets.rake
namespace :assets do
desc "Check that all assets have valid encoding"
task :check => :environment do
paths = ["app/assets", "lib/assets", "vendor/assets"]
extensions = ["js", "coffee", "css", "scss"]
paths.each do |path|
dir_path = Rails.root + path
rodrigo-lima / gist:2631940
Created May 8, 2012
NSURLConnection + Basic Auth
View gist:2631940
@implementation WhateverClass
+ (NSString *)getBasicAuth
NSData *encodeData = [[NSString stringWithFormat:@"%@:%@", username, password]
// from NSData+Base64.m by Matt Gallagher
NSString *credentials = [encodeData base64EncodedString];
caike / template.rb
Created Jun 23, 2012
Rails 3.2.6 template w/ Twitter Bootstrap
View template.rb
app_name = ARGV[0]
initial_resource_name = ask('What is your initial resource ?')
remove_file 'Gemfile'
create_file 'Gemfile', <<-eos
source ''
gem 'rails', '3.2.6'
TJkrusinski /
Created Feb 10, 2014
Syntax highlighting in keynote made easy

Keynote I guess pushed an update that doesn't take hightlighted code from xCode anymore. So, I googled around and found hightlight. It is a super useful utitlity to do syntax highlighting from the command line.

$ brew install hightlight

If you are on Mavericks you may need to brew link lua to get it working right.

Hightlight has support for all kinds of languages and themes and it can wrap the code with line numbers, which is great.

View cart.exs
# from ounce of elixir
defmodule CartTest do
use ExUnit.Case
test "starts with empty count" do
assert Cart.count_items([]) == 0
View gist:f5f597f04b2efcb711c7
require 'mechanize'
require 'moving_average'
mechanize =
login_page = mechanize.get ''
form = login_page.forms.first
# noinspection RubyResolve
form.field_with(id: 'username').value = "username"
form.field_with(id: 'password').value = "pass"
You can’t perform that action at this time.