Create a file defining the following variables, with the name .env-for-dump
, for example.
export MYSQL_CONTAINER=
export MYSQL_ORIGIN_PASSWORD=
export MYSQL_ORIGIN_USERNAME=
#!/bin/sh | |
# | |
# Salve este script no diretório /etc/cron.hourly e dê permissão | |
# de execução a ele. Desse modo a cada hora sera verificada se a | |
# porcentagem de memória utilizada pelo sistema atingiu o valor definido | |
# na variável 'percent'. Caso positivo, o script informará ao kernel | |
# que este deverá alterar o valor da opção 'drop_caches' para 3. | |
# | |
# Mais detalhes: 'man proc' -> /proc/sys/vm/drop_caches. | |
PATH="/bin:/usr/bin:/usr/local/bin" |
#! /bin/bash | |
# | |
# How to use it | |
# | |
# $ chmod +x lock-screen | |
# | |
# $ ./lock-screen.sh | |
# | |
# You can create a custom keyborad shortcut (like Super+l) that call this script | |
# |
You are writing a spec with type: :request
, i.e. an integration spec instead
of a controller spec. Integration specs are wrappers around Rails'
ActionDispatch::IntegrationTest
class. I usually write controller tests using
this instead of type: :controller
, mainly because it exercises more of the
request and response handling stack. So instead of writing something like
get :index
to start the request, you would write get books_path
or similar.
One of the issues with using type: :request
is that you lose the ability to
# -*- encoding : utf-8 -*- | |
# | |
# Rodrigo Soares Manhães, professor homenageado pelos formandos da turma de 2007 | |
# do curso de Ciência da Computação da UENF. | |
# | |
# 20/09/2012 | |
# | |
## | |
class Aluno < ActiveRecord::Base |
# Ajax testing with ruby and capybara | |
# | |
# Add this to spec/support | |
# | |
# When a link or button starts an ajax request, instead of use Capybara | |
# click_link, click_button and click_link_or_button methods use click_ajax_link, | |
# click_ajax_button and click_ajax_link_or_button methods. You can still use | |
# capybara methods and right after it, call wait_for_ajax method. | |
# | |
# This methods will wait until Capybara.default_max_wait_time for the ajax request |
# Handy Extract Program | |
extract () { | |
if [[ -f $1 ]]; then | |
case $1 in | |
*.tar.bz2) tar xvjf $1 ;; | |
*.tar.gz) tar xvzf $1 ;; | |
*.bz2) bunzip2 $1 ;; | |
*.rar) unrar x $1 ;; | |
*.gz) gunzip $1 ;; | |
*.tar) tar xvf $1 ;; |
# https://askubuntu.com/a/832534 | |
gsettings set org.cinnamon.settings-daemon.peripherals.touchpad touchpad-enabled true |
# Add this to a custom keyboard shortcut (recommended the pause/break) | |
amixer set Capture toggle | |
# reference: http://askubuntu.com/a/13364 |
require 'httparty' | |
# Este recurso tem como finalidade encontrar um endereço através de um CEP, e | |
# para isso ele utiliza o web service da Via Cep (http://viacep.com.br/) | |
# Obviamente, para utilizar este serviço é necessário uma conexão com a Internet. | |
# | |
# Como fazer a busca de endereço por cep? | |
# | |
# AddressFinder.cep(28053040) | |
# AddressFinder.cep('28053040') |