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
def method_missing(name, *args) | |
puts "<#{name}>#{args[0]}" | |
yield if block_given? | |
puts "</#{name}>" | |
end | |
html do | |
body do | |
h1 "My internal DSL" | |
div 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($){ | |
var merge = function(el, cp) { | |
for(i in cp) { | |
if( typeof cp[i] == 'object') { | |
if(el[i] == undefined) { | |
el[i] = cp[i] | |
} | |
merge(el[i], cp[i]); | |
} else { |
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
Uma Formiga era produtiva e feliz. | |
O empresário Marimbondo estranhou a Formiga trabalhar sem supervisão, e colocou uma Barata como supervisora. | |
A Barata logo padronizou o horário de entrada e saída da formiga. | |
Em seguida contratou uma secretária, D. Aranha para organizar arquivos e controlar as ligações e análise das reuniões. | |
A Barata contratou também uma Mosca. | |
A Formiga começou a se lamentar do tempo gasto com papéis e reuniões. | |
O Marimbondo resolveu ter um gestor para a área da Formiga. | |
O cargo foi dado a uma Cigarra. | |
A Formiga, que já não cantarolava mais, cada dia se tornava mais chateada. |
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
#Models | |
class Vaga < ActiveRecord::Base | |
has_many :idioma_vagas | |
has_many :idiomas, :through => :idioma_vagas | |
accepts_nested_attributes_for :idiomas, :allow_destroy => true | |
accepts_nested_attributes_for :idioma_vagas, :allow_destroy => true | |
def idiomas_attributes=(attributes) |
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 'spec/expectations' | |
$CLASSPATH << "./bin" | |
include_class 'org.milfont.Issue' | |
Dado /^um problema reportado como "([^\"]*)"$/ do |name| | |
@issue = Issue.new name | |
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
#usando o google como host do jquery | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script> | |
#código ajax | |
$(document).ready(function() { | |
$("#id_estado").change(function() { | |
$.getJSON("municipios/"+$(this.id)+"/municipios.json", | |
function(data){ | |
$.each(data, function(i, item){ |
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
var sair_sistema = function(url, obj){ | |
Ext.Msg.confirm('Sair','Deseja sair do sistema?',function(resposta){ | |
if (resposta == "yes") { | |
var f = document.createElement('form'); | |
f.style.display = 'none'; | |
obj.parentNode.appendChild(f); | |
f.method = 'POST'; | |
f.action = url; | |
var m = document.createElement('input'); | |
m.setAttribute('type', 'hidden'); |
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
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
#estagio 1 | |
def self.idade(data) | |
idade_ano = (Date.today.year - data.year) | |
if Date.today.month > data.month | |
idade_ano | |
elsif Date.today.month == data.month && Date.today.day == data.day | |
idade_ano | |
elsif Date.today.month < data.month | |
idade_ano - 1 | |
elsif Date.today.month == data.month && Date.today.day < data.day |
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
git clone git@github.com:cmilfont/bddonrails.git | |
cd bddonrails/ | |
sudo rake gems:install RAILS_ENV=test | |
#lembre de trocar a senha do root no mysql ou mudar o banco | |
rake db:create:all | |
rake db:migrate | |
rake cucumber:ok |
OlderNewer