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
{ | |
:AC=>"Acre", | |
:AL=>"Alagoas", | |
:AP=>"Amapá", | |
:AM=>"Amazonas", | |
:BA=>"Bahia", :CE=>"Ceará", | |
:DF=>"Distrito Federal", | |
:ES=>"Espírito Santo", | |
:GO=>"Goiás", | |
:MA=>"Maranhão", |
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
ESTADOS_BRASILEIROS = [ | |
["Acre", "AC"], | |
["Alagoas", "AL"], | |
["Amapá", "AP"], | |
["Amazonas", "AM"], | |
["Bahia", "BA"], | |
["Ceará", "CE"], | |
["Distrito Federal", "DF"], | |
["Espírito Santo", "ES"], | |
["Goiás", "GO"], |
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
#file bin/rails | |
--------------- | |
#!/usr/bin/env ruby | |
begin | |
load File.expand_path('../spring', __FILE__) | |
rescue LoadError => e | |
raise unless e.message.include?('spring') | |
end | |
APP_PATH = File.expand_path('../../config/application', __FILE__) |
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
VAGRANTFILE_API_VERSION = '2' | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.box = '<your>/<box>' | |
config.ssh.insert_key = false # linha obrigatória para Windows | |
config.vm.network :forwarded_port, guest: 3000, host: 3000 # rails | |
config.vm.network :forwarded_port, guest: 9292, host: 9292 # rack | |
config.vm.network :forwarded_port, guest: 4567, host: 4567 # sinatra | |
config.vm.network :forwarded_port, guest: 1080, host: 1080 # mailcatcher |
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 "faker" | |
class User | |
attr_accessor :name, :address | |
def initialize(name = "Fulano", address = "Rua do sobe e desce") | |
@name = name | |
@address = address | |
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
Customer = Struct.new(:name, :address, :zip) | |
customers = [] | |
customers.push(Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)) | |
customers.push(Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)) | |
customers.push(Customer.new("Jane Doe", "456 Elm, Anytown NC", 12345)) | |
customers.each do |customer| | |
puts customer.name | |
puts customer.address |
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.allowAction = function(element) { | |
var message = element.attr('data-confirm'); | |
if (!message) { return true; } | |
var opts = { | |
title: "Confirmação", | |
message: message, | |
buttons: { | |
confirm: { | |
label: 'Sim', |
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
/** Print css **/ | |
@media print { | |
body.modalprinter * { | |
visibility: hidden; | |
} | |
body.modalprinter .modal-dialog.focused { | |
position: absolute; | |
padding: 0; |
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
$(document).ready(function() { | |
// Global ajax cursor change | |
$(document) | |
.ajaxStart(function () { | |
$('#global-spin').fadeIn('slow'); | |
}) | |
.ajaxStop(function () { | |
$('#global-spin').fadeOut('slow'); | |
}); | |
}); |
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
set :application, '<Nome da sua App>' # Nome da sua aplicação | |
set :repo_url, 'git@exemplo.com:eu/sua_app.git' # Repositório git do seu projeto | |
set :deploy_to, '/var/www/escamboapp' | |
set :scm, :git | |
set :branch, 'master' | |
set :keep_releases, 5 | |
set :format, :airbrussh | |
set :log_level, :debug | |
append :linked_files, "config/database.yml" | |
append :linked_dirs, "log", "tmp/pids", "tmp/cache", "tmp/sockets", "public/system" |
OlderNewer