Skip to content

Instantly share code, notes, and snippets.

@alextakitani
alextakitani / gems.markdown
Last active Feb 8, 2019
Gems #ruby #rails #gems
View gems.markdown
@alextakitani
alextakitani / cloudSettings
Created Jan 22, 2019
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2019-01-22T12:04:50.310Z","extensionVersion":"v3.2.4"}
@alextakitani
alextakitani / upgrade-postgres-10-to-11.md
Last active Oct 30, 2018 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 10 to 11 on Ubuntu 18.04
View upgrade-postgres-10-to-11.md

TL;DR

Install Postgres 11, and then:

sudo pg_dropcluster 11 main --stop
sudo pg_upgradecluster 10 main
sudo pg_dropcluster 10 main
@alextakitani
alextakitani / upgrade-postgres-9.3-to-9.5.md
Created Jun 8, 2017 — forked from johanndt/upgrade-postgres-9.3-to-9.5.md
Upgrading PostgreSQL from 9.3 to 9.5 on Ubuntu
View upgrade-postgres-9.3-to-9.5.md

TL;DR

Install Postgres 9.5, and then:

sudo pg_dropcluster 9.5 main --stop
sudo pg_upgradecluster 9.3 main
sudo pg_dropcluster 9.3 main
View gist:7502268f28695b4e29a0
<!-- Modal Filtro -->
<div class="modal fade" id="ModalFilter" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
<%= form_tag countries_path, method: :get do %>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="ModalLabel">Filtro</h4>
View gist:364acf1559fbad363847
require 'rubygems'
require 'mechanize'
require 'pp'
a = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
a.get('https://google.com/') do |page|
search_result = page.form_with(:action => '/search') do |search|
search.q = 'Hello world'
View alias.txt
alias dm='rake db:migrate'
alias dmt='rake db:migrate && rake db:test:prepare'
alias dmp='RAILS_ENV=production rake db:migrate'
alias rc='rails c'
alias rg='rails g'
alias rcp='RAILS_ENV=production rails c'
alias rs='rails s'
alias rsp='RAILS_ENV=production rails s'
alias zdm='zeus rake db:migrate'
alias zdmt='zeus rake db:migrate && zeus rake db:test:prepare'
@alextakitani
alextakitani / up_postgres.sh
Last active Oct 5, 2016
Upgrade postgres ubuntu
View up_postgres.sh
sudo echo "deb http://apt.postgresql.org/pub/repos/apt/ xenial-pgdg main" >> /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install postgresql-9.6 postgresql-contrib-9.6 libpq-dev
cd /tmp
@alextakitani
alextakitani / gist:6413691
Last active Mar 10, 2019
cedilha em taclado us-internacional, no mint 18
View gist:6413691
Editar
sudo xed /usr/lib/x86_64-linux-gnu/gtk-3.0/3.0.0/immodules.cache
sudo xed /usr/lib/x86_64-linux-gnu/gtk-2.0/2.10.0/immodules.cache
Adicionar :en na linha "cedilla"
sudo xed /usr/share/X11/locale/en_US.UTF-8/Compose
substituir "ć" por "ç" e "Ć" por "Ç". ( Contrl + h )
View post_install.sh
#atualizado para mint 19
# como usar:
# Clique ali em cima no botão raw
# salve o arquivo no seu disco.
# abra o terminal na pasta onde vc baixou o arquivo.
# de permissão de execução chmod +x post_install.sh
# rode:
# ./post_install.sh
# coloque sua senha
You can’t perform that action at this time.