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
guybrush / nodeconf_2011.md
Created May 6, 2011
a list of slides from nodeconf 2011
@jswanner
jswanner / after_use_192-patched.sh
Created Aug 2, 2011
How to patch ruby for GC tuning and faster requiring
View after_use_192-patched.sh
case "$rvm_ruby_string" in
*ruby-1.9.2*-patched)
export RUBY_HEAP_MIN_SLOTS=1000000
export RUBY_HEAP_SLOTS_INCREMENT=1000000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=1000000000
export RUBY_HEAP_FREE_MIN=500000
export RUBY_FREE_MIN=$RUBY_HEAP_FREE_MIN
;;
*)
@jswanner
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
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
rodrigo-lima / gist:2631940
Created May 8, 2012
NSURLConnection + Basic Auth
View gist:2631940
@implementation WhateverClass
+ (NSString *)getBasicAuth
{
NSData *encodeData = [[NSString stringWithFormat:@"%@:%@", username, password]
dataUsingEncoding:NSUTF8StringEncoding];
// from NSData+Base64.m by Matt Gallagher
NSString *credentials = [encodeData base64EncodedString];
@caike
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 'https://rubygems.org'
gem 'rails', '3.2.6'
@TJkrusinski
TJkrusinski / syntax.md
Created Feb 10, 2014
Syntax highlighting in keynote made easy
View syntax.md

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
#https://www.meetup.com/Women-Who-Code-Tampa/events/233014583/
ExUnit.start
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 = Mechanize.new
login_page = mechanize.get 'https://www.myfitnesspal.com/account/login'
form = login_page.forms.first
# noinspection RubyResolve
form.field_with(id: 'username').value = "username"
form.field_with(id: 'password').value = "pass"
form.submit
You can’t perform that action at this time.