This file contains hidden or 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
| environment = ARGV.first | |
| unless environment | |
| puts 'Usage: ruby ask_ey.rb [EY_ENVIRONMENT]' | |
| puts '' | |
| puts 'You could try:' | |
| puts '' | |
| puts ' ruby ask_ey.rb Rankia003_Large' | |
| puts '' | |
| exit |
This file contains hidden or 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
| A fulanito no le llegan los correos: | |
| https://www.gliffy.com/go/html5/5656107?app=1b5094b0-6042-11e2-bcfd-0800200c9a66 | |
| Cómo hacer preguntas de manera inteligente | |
| http://www.sindominio.net/ayuda/preguntas-inteligentes.html | |
| http://www.rankia.com/blog/doble-o-nada/2098530-finanzas-bolsa-inversion-libros-disponibles-para-descargar | |
| Download videos from youtube.com or other video platforms: | |
| https://github.com/rg3/youtube-dl |
This file contains hidden or 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
| it 'debe ser factoría válida' do | |
| promocion = FactoryGirl.create(:promocion) | |
| 1000.times do | |
| usuario_ejemplo = FactoryGirl.create(:usuario_con_telefono) | |
| lead = FactoryGirl.create(:lead, promocion: promocion, nombre: usuario_ejemplo.nombre, apellido1: usuario_ejemplo.apellidos,telefono: usuario_ejemplo.telefono, email: usuario_ejemplo.email, empresa: Faker::Lorem.words(3).join) | |
| lead.save | |
| expect(lead.errors).to be_empty | |
| end | |
| end |
This file contains hidden or 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
| https://support.cloud.engineyard.com/hc/en-us/articles/205408228-Promote-a-Database-Replica | |
| En la BD réplica, antes de parar máquinas, comprobar el tiempo de la última sincronización (debe ser menor que 1 minuto): | |
| psql -U postgres -t -c "SELECT (now() - pg_last_xact_replay_timestamp()) AS time_lag;" | |
| En el App Master: | |
| /etc/init.d/vixie-cron status | |
| sudo /etc/init.d/vixie-cron stop | |
| UPDATE: You'll need to be careful with vixie-cron stop. Your instances have a "cron nanny" task that is designed to restart cron in the event it should stop and this does carry the potential that cron could restart during your promotion. Depending on your scheduling of course this might not impact anything. The cron_nanny task itself is managed by inittab so it will restart automatically if killed. |
This file contains hidden or 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
| Hemos hecho un scaffolding para validar con nuestro cliente una propuesta: | |
| rails g scaffold Client first_name:string last_name:string email:string phone:string city:string address:string website:string | |
| Esto genera, entre otros, el archivo _form.html.haml incluido en este Gist. | |
| Una vez que el scaffolding ha sido validado, lo queremos "pasar a limpio"; y lo primero que nos pide un refactor son todas esas repeticiones de las mismas tres líneas para cada campo: | |
| .field | |
| = f.label xxxx |
This file contains hidden or 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 'rails_helper' | |
| require 'temping' | |
| Temping.create :bebedor do | |
| include Tematizable | |
| end | |
| describe Tematizable do | |
| let(:cerveza) { create(:tematica, nombre: 'cerveza') } | |
| let(:whisky) { create(:tematica, nombre: 'whisky') } |
This file contains hidden or 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 'active_support/concern' | |
| module Tematizable | |
| extend ActiveSupport::Concern | |
| included do | |
| has_many :tematizaciones, as: :tematizable, class_name: 'Tematizacion' | |
| has_many :tematicas, through: :tematizaciones | |
| end |
This file contains hidden or 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
| class CreateFinalidadPrestamo < ActiveRecord::Migration | |
| def up | |
| execute <<-SQL | |
| CREATE TYPE finalidad_prestamo AS | |
| ENUM ('Reunificar deudas', 'Estudios', 'Imprevistos', 'Compra de vehículo', 'Viaje', 'Reformas hogar', 'Otros'); | |
| SQL | |
| end | |
| def down | |
| execute <<-SQL |
This file contains hidden or 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
| class CreatePrestamos < ActiveRecord::Migration | |
| def change | |
| create_table :prestamos do |t| | |
| ... | |
| t.column :finalidad, :finalidad_prestamo | |
| ... | |
| end | |
| end | |
| end |
This file contains hidden or 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
| class AddFinalidadToPrestamos < ActiveRecord::Migration | |
| def change | |
| add_column :prestamos, :finalidad, :finalidad_prestamo | |
| end | |
| end |