This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ============================== | |
# Uploads | |
# ============================== | |
namespace :uploads do | |
desc <<-EOD | |
Creates the upload folders unless they exist | |
and sets the proper upload permissions. | |
EOD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mechanize' | |
require 'hpricot' | |
class Orkut | |
def initialize(email, pass) | |
@agent = WWW::Mechanize.new | |
@email = email | |
@pass = pass | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :assets do | |
task :symlink, :roles => :app do | |
assets.create_dir | |
run <<-CMD | |
rm -rf #{current_path}/public/images/upload && | |
ln -nfs #{shared_path}/upload #{release_path}/public/images/upload | |
CMD | |
end | |
task :create_dir, :roles => :app do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function reverseMenuItem() { | |
$('li.main').each(function(i) { | |
qnt = $('li.main').length; | |
if (i == (qnt-1) || i == (qnt-2)) { | |
li_width = $('li.main:eq('+i+')').width(); | |
ul_width = $('li.main:eq('+i+') ul').width() + 24 - li_width; | |
$('li.main:eq('+i+') ul').css({ | |
marginLeft: -ul_width | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% semantic_form_for @post do |form| %> | |
<% form.inputs :name => "Basic", :id => "basic" do %> | |
<%= form.input :title %> | |
<%= form.input :cpf, :mask => '999.999.999-99' %> | |
<%= form.input :cep, :mask => '99.999-999' %> | |
<% end %> | |
<% form.buttons do %> | |
<%= form.commit_button %> | |
<% end %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# basico, to testando desta forma | |
# action | |
def new | |
@driver = Driver.new | |
end | |
# teste com remarkable | |
describe :get => :new do | |
expects :new, :on => Driver, :returns => driver_proc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove arquivos desnecessários | |
run "rm public/index.html" | |
run "rm public/favicon.ico" | |
run "rm README" | |
run "rm doc/README_FOR_APP" | |
# gera um controller home e action index | |
generate :controller, "home", "index" | |
# define a rota root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# model Curso | |
# app/model/course.rb | |
class Course < ActiveRecord::Base | |
has_many :payments, :order => "id" | |
accepts_nested_attributes_for :payments, :allow_destroy => true, | |
:reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } } | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export GREP_OPTIONS="--color=auto" | |
export GREP_COLOR="4;33" | |
export CLICOLOR="auto" | |
source ~/.git-completion.sh | |
export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home" | |
export SCALA_HOME="/usr/local/scala-2.7.7.final" | |
export JAVA="$JAVA_HOME/bin/java" | |
export SCALA="$SCALA_HOME/bin/scala" | |
export PATH="$JAVA_HOME/bin:$SCALA_HOME/bin:/usr/local/mysql/bin:$PATH" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Trocar de abas dentro do gvim usando Alt+1, Alt+2... | |
" Editar o arquivo ~/.vimrc e inserir os dados abaixo | |
"tabs | |
map <D-1> 1gt | |
map <D-2> 2gt | |
map <D-3> 3gt | |
map <D-4> 4gt | |
map <D-5> 5gt | |
map <D-6> 6gt |