Skip to content

Instantly share code, notes, and snippets.

View cmilfont's full-sized avatar

Christiano Milfont cmilfont

View GitHub Profile

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

Factory.define :item do |f|
include ActionDispatch::TestProcess
f.name "Macbook Pro 15"
f.price_in_dollars 1500
f.photo fixture_file_upload('/files/avatar.jpg', 'image/jpg')
end
@cmilfont
cmilfont / capybara cheat sheet
Created February 24, 2012 13:51 — 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')
@cmilfont
cmilfont / pizza.R
Created January 11, 2012 08:25 — forked from tautologico/pizza.R
Sistema de recomendação para companheiro de pizza
# Em resposta a
# http://blog.concretesolutions.com.br/2011/12/testinho-numero-2/
### Dados (na ordem: Marguerita, 4 queijos, escarola, portuguesa, frango+catupiry, napolitana)
renato <- list(nome='renato', notas=c(4, 5, 4, 5, 4, 3))
marcelo <- list(nome='marcelo', notas=c(2, 2, 1, 3, 5, 2))
lenon <- list(nome='lenon', notas=c(4, 5, 2, 1, 1, 3))
renata <- list(nome='renata', notas=c(4, 5, 1, 1, 3, 4))
washington <- list(nome='washington', notas=c(1, 1, 2, 3, 4, 3))
tino <- list(nome='tino', notas=c(1, 5, 1, 4, 3, 2))
@cmilfont
cmilfont / goat.rb
Created December 1, 2011 18:58 — forked from cykod/goat.rb
RCov + `git blame` = Find out who the non-testing Goat on your Rails project is
#!/usr/bin/env ruby1.8
require 'rubygems'
require 'nokogiri'
# Copyright @2011 Pascal Rettig - Released under the MIT License,
# No Warranty whatsoever. This will probably destroy your project
#
# Find out who the goat is on your Rails the project - i.e the person responsible for
# writing or modifying the most untested code. Drop goat.rb into your script/
# directory, make it executable then run:
@cmilfont
cmilfont / inflections.rb
Created November 15, 2011 11:54 — forked from mateusg/inflections.rb
pt-BR inflections file for Ruby on Rails applications
# encoding: utf-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
# ActiveSupport::Inflector.inflections do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
@cmilfont
cmilfont / tbodyScroll.css
Created October 31, 2011 17:51 — forked from henriquegogo/tbodyScroll.css
Scroll on TBODY
table {
display: block;
width: 100%;
}
table thead tr {
display: block;
}
table th,
table td { width: 100px; min-width: 100px; }
table tbody {
@cmilfont
cmilfont / sammyjs
Created October 12, 2011 20:58 — forked from hvitorino/sammyjs
sammyjs
//Rota no Sammy
this.get('#/evento/criar', Views.Evento.Criacao.Inicializa);
// Arquivo da View
;(function() {
if(!Views.Evento)
Views.Evento = { };
Views.Evento.Criacao = function (ctx) {
var self = this;
@cmilfont
cmilfont / jquery.ba-tinypubsub.js
Created July 7, 2011 21:02 — forked from cowboy/HEY-YOU.md
jQuery Tiny Pub/Sub: A really, really, REALLY tiny pub/sub implementation for jQuery.
/*!
* jQuery Tiny Pub/Sub - v0.6 - 1/10/2011
* http://benalman.com/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
*/
(function($){
@cmilfont
cmilfont / david_herman_brazilJS_2011_pt-br.srt
Created June 25, 2011 12:57
Legenda em pt-br - David Herman - BrazilJS 2011
1
00:00:09,502 --> 00:00:11,578
Muito obrigado.
2
00:00:13,485 --> 00:00:19,276
Sinto muito por não ter aprendido português no caminho
3
00:00:20,630 --> 00:00:26,054