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
ActiveRecord::Base.connection.tables.each do |table_name| | |
next if table_name == 'ar_internal_metadata' | |
next unless ActiveRecord::Base.connection.columns(table_name).map(&:name).include?('id') | |
ActiveRecord::Base.connection.execute "SELECT setval('#{table_name}_id_seq', (SELECT MAX(id) FROM #{table_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
# bin/bash | |
# Has configured swap? | |
# sudo swapon -s | |
sudo fallocate -l 1G /swapfile | |
sudo chmod 600 /swapfile | |
sudo mkswap /swapfile |
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
sudo apt-get install git autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev | |
ssh-keygen -t rsa -b 4096 -C "[email protected]" | |
eval "$(ssh-agent -s)" | |
ssh-add ~/.ssh/id_rsa | |
cat ~/.ssh/id_rsa.pub | |
# registrer key at gitlab https://gitlab.com/profile/keys | |
# install rbenv | |
git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
cd ~/.rbenv && src/configure && make -C src |
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 'nokogiri' | |
require 'open-uri' | |
BASE_URL = 'https://octodex.github.com' | |
DESTINATION_FOLDER = "/Users/joseramonc/src/images/octodex" | |
octodex = Nokogiri::HTML open BASE_URL | |
octodex.css('.preview-image').each do |preview| | |
absolute_path = preview.css('img')[0]['data-src'] |
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
// triangle | |
&:after { | |
left: 50%; | |
position: relative; | |
display: inline-block; | |
border-right: 6px solid transparent; | |
border-top: 6px solid $blue; // change with border-bottom for triangle pointing up | |
border-left: 6px solid transparent; | |
content: ''; | |
} |
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 allCB | |
@corporativoCB = Corporativo.all | |
@clasesActividadCB = ClaseActividad.all | |
@clasificadorCB = ClasificadorSe.all | |
@clasificador_id = -1; | |
@clases_actividad_id =-1; | |
@countryCB = Country.all | |
@stateCB = Array.new# = State.all | |
@municipioCB=Array.new# = Municipio.all |