Skip to content

Instantly share code, notes, and snippets.

View hugobarauna's full-sized avatar

Hugo Baraúna hugobarauna

View GitHub Profile
Tutorial geral sobre Rails: http://www.railstutorial.org/
---------------------------------------------------------
Esse tutorial é indicado para quem está começando com Rails. Ele ensina Rails através da construção de um aplicativo semelhante ao Twitter. O legal dele é que além de passar pela tecnologia, ele fala também de Git, TDD Restful controllers e outras coisas mais.
Rails Guides: http://guides.rubyonrails.org/
--------------------------------------------
Indicado para nível iniciante e médio. Guias sobre vários componentes do Rails. Explica muito bem coisas como associações entre models, rotas e outras coisas mais. Muito recomendado ler todos os guias.
#!/bin/sh
# Install ImageMagick on Snow Leopard: by kain, improved by mislav and samsoffes
# http://www.icoretech.org/2009/08/install-imagemagick-in-leopard-snow-leopard/
# Work with 64bit kernel mode
set -e
PREFIX=/usr/local
# Passenger users: amend your Apache global configuration with the following directive
# SetEnv PATH /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Rails CMS alternatives
======================
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
"the cutting edge Rails CMS platform"
Program
program = { decl }
Declarações
decl = type var_list | type id "=" ( id | num | expr ) | func_decl | array | struct.
var_list = id { "," id } "\n".
array = type id "[" num "]" | type id "[" num "]" "=" "{" cte {, cte} "}".
struct = "struct" id "{" struct_var_list "}"
struct_var_list = type id "\n" { type id "\n" }.
type = "int" | "char" | "float" | "bool" | "void".
# Used to graph results from autobench
#
# Usage: ruby autobench_grapher.rb result_from_autobench.tsv
#
# This will generate three svg & png graphs
require "rubygems"
require "scruffy"
require 'csv'
require 'yaml'
Depois de instalar o Ubuntu 9.04, os meus whitespaces do gedit (feito pelo plugin draw spaces) ficaram com cor branca e estavam confundindo meu código. Se você também usa o Gedit, usa o tema darkmate, usa o plugin draw spaces e também teve esse problema, basta fazer o seguinte:
1. Feche seu Gedit
2. Abra o shell e faça "cd /usr/share/gtksourceview-2.0/styles"
3. Dentro desse diretório, deve haver um arquivo chamado darkmate.xml, apague esse arquivo
4. Crie um novo arquivo darkmate.xml nesse diretorio e copie o texto abaixo xml abaixo para esse arquivo
5. Abra seu gedit novamente, tudo deve estar ok. Happy coding!
<?xml version="1.0" encoding="UTF-8"?>
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_deleted {
[[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-"
}
function parse_git_added {
[[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+'
module Spec
module Rails
module Example
# Controller Examples live in $RAILS_ROOT/spec/controllers/.
#
# Controller Examples use Spec::Rails::Example::ControllerExampleGroup, which supports running specs for
# Controllers in two modes, which represent the tension between the more granular
# testing common in TDD and the more high level testing built into
# rails. BDD sits somewhere in between: we want to a balance between
# specs that are close enough to the code to enable quick fault
contacts = wl.contacts(path)
#-> [ ['Fitzgerald', '[email protected]', '[email protected]'],
# ['William Paginate', '[email protected]'], ...
# ]
yahoo = Contacts::Yahoo.new
auth_url = yahoo.get_authentication_url