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
#Comandos úteis para o git | |
# exibir quantos commits por autor | |
git log | grep ^Author | cut -d\< -f1 | sort | uniq -c | sort -n -r | head -20 | |
#formatar o grafo de commits com um alias lg | |
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative" | |
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
rails nomedoprojeto -d mysql | |
cd nomedoprojeto | |
rake db:create:all | |
script/generate scaffold pessoa nome:string idade:float nascimento:date | |
rake db:migrate | |
script/generate rspec | |
script/generate rspec_scaffold pessoa nome:string idade:float nascimento:date | |
rake spec | |
script/generate cucumber | |
script/generate feature pessoa nome:string idade:float nascimento:date |
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
#http://caldersphere.rubyforge.org/warbler/ | |
#~/projetos/minha_aplicacao/config/warble.rb | |
Warbler::Config.new do |config| | |
config.dirs = %w(app config lib log vendor tmp) | |
config.excludes = FileList["lib/tasks/*", "db/meta_data/*", "doc/projeto/**/*", "features/**/*", "log/*","spec/**/*", "test/**/*","tmp/war/**/*", "tmp/*.png", "vendor/remarkable/**/*", "vendor/selenium-server/**/*"] | |
config.java_libs += FileList["#{RAILS_ROOT}/vendor/plugins/jasper-reports-integration/jars/*.jar"] | |
config.gems += ["jruby-openssl", "activerecord-jdbc-adapter"] | |
config.gem_dependencies = true | |
config.webxml.jruby.min.runtimes = 2 |
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
#/home/cmilfont/.bashrc | |
export JRUBY_HOME=/home/cmilfont/jruby-1.3.1 | |
export PATH=$JRUBY_HOME/bin:$PATH | |
#~/projetos/minha_aplicacao/config/environments/production.rb | |
config.action_controller.asset_host = 'http://192.168.0.1:8080' | |
#~/projetos/minha_aplicacao/config/environment.rb | |
def is_jruby? | |
RUBY_PLATFORM =~ /java/i |
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
#arquivo spec_helper.rb | |
ENV["RAILS_ENV"] ||= 'test' | |
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment')) | |
require 'spec/autorun' | |
require 'spec/rails' | |
require 'rake' | |
require 'ruby-debug' unless RUBY_VERSION > '1.9' |
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 "net/http" | |
class JojobaSunspot | |
def start | |
@started = Time.now | |
up_sunspot if starting | |
up | |
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
# | |
# bash completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# | |
# *) local and remote branch names |
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
/* essa chamada evita o conflito com outros | |
frameworks que usam dollar ($) */ | |
jQuery.noConflict(); | |
(function($) { | |
// Seu código jquery vai aqui | |
$("#id_do_elemento").load("caminho.html"); | |
})(jQuery); | |
//codigo prototype |
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
$J = jQuery.noConflict(); | |
//codigo prototype | |
$("id_de_algum_elemento").hide(); | |
//codigo jquery em seguida | |
$J("#id_do_elemento").load("caminho.html"); |
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
Discussão sobre os motivos de não iniciar a modelagem de domínio | |
de um sistema pelo banco de dados. |