Skip to content

Instantly share code, notes, and snippets.

View fabianoleittes's full-sized avatar
🌍
Working from home

Fabiano Leite fabianoleittes

🌍
Working from home
View GitHub Profile
@fabianoleittes
fabianoleittes / gist:4080131
Created November 15, 2012 18:00 — forked from codenamev/gist_on_tumblr.js
Embed GitHub gist on your Tumblr
// REQUIRES:
// http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js
// http://static.tumblr.com/fpifyru/VCxlv9xwi/writecapture.js
// Based on: https://gist.github.com/1395926
$(document).ready(function() {
$('.gist').each(function(i) {
var file_separator = $(this).text().indexOf('#');
if (file_separator != -1) {
var gist_url = $(this).text().slice(0, file_separator);
var gist_file = $(this).text().slice(file_separator).replace("#file_", "?file=");
# encoding: utf-8
pt-BR:
address_full: "Endereço Completo:"
neighborhood: "Bairro"
number: "Número:"
complement: "Complemento:"
zipcode: "CEP:"
state: "Estado:"
city: "Cidade:"
# encoding: utf-8
require "spec_helper"
describe "Logout" do
context "when logged in" do
user = Factory(:mgt_admin)
use_mgt_host
@fabianoleittes
fabianoleittes / uninstall_gems.sh
Created November 5, 2012 15:46 — forked from chumpy/uninstall_gems.sh
Uninstall all gems
#! /bin/bash
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
@fabianoleittes
fabianoleittes / capybara_cheat_sheet.md
Created November 5, 2012 15:44 — forked from chumpy/capybara_cheat_sheet.md
capybara cheat sheet

Capybara Cheat Sheet

Navigating

  visit('/projects')
  visit(post_comments_path(post))
@fabianoleittes
fabianoleittes / capybara cheat sheet
Created November 5, 2012 15:29 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@fabianoleittes
fabianoleittes / template.rb
Created October 25, 2012 16:47 — forked from caike/template.rb
Rails 3.2.6 template w/ Twitter Bootstrap
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'
@fabianoleittes
fabianoleittes / authenticator.rb
Created October 11, 2012 22:36
Simple Authentication
class Authenticator
def self.authenticate(email, password, encryption_engine = BcryptAdapter)
user = User.find_by_email(email)
return unless user
actual_hash = encryption_engine.encryptor(password, user.password_salt)
return user if user.password_hash == actual_hash
@fabianoleittes
fabianoleittes / gist:3605293
Created September 2, 2012 22:41 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@fabianoleittes
fabianoleittes / st_cheat.txt
Created April 16, 2012 14:21 — forked from bjhess/st_cheat.txt
Sublime Text Cheatsheet
Navigation:
cmd-p Goto Anything ('@' for functions, ':' for line number)
cmd-r Function finder
ctl-g Goto line number
cmd-sft-p Command palette
cmd-sft-f Find in Files
cmd-opt-r Toggle regex when finding
cmd-opt-# Columns
ctr-# Switch columns