Skip to content

Instantly share code, notes, and snippets.

@serradura
serradura / experiment.rb
Last active October 20, 2020 02:11
Create a proxy to track the usage of the Ruby send method
module Words1
def self.foo; "foo1"; end
def self.bar; "bar1"; end
end
module Words2
extend self
private
@maiconkcond
maiconkcond / vagrant.txt
Created October 1, 2017 22:41
How to create a machine with vagrant and virtualbox
Instalando e configurando o Vagrant
1) Baixe e instale o VirtualBox (virtualbox.org​)
2) Baixe e instale o Vagrant (vagrantup.com​)
3) Acesse o vagrandcloud.com​ e escolha sua box base
4) Adicione a box ao vagrant (vagrant box add <sua>/<box>​)
5) Caso esteja usando o Windows configure o puTTY
a) Baixe o puTTY e o puTTYgen (putty.org)
b) Baixe a chave privada
(https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant)
c) Abra o puTTYgen, clique em "LOAD​" e informe a chave privada que você baixou
@subfuzion
subfuzion / curl.md
Last active September 20, 2024 18:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@JunichiIto
JunichiIto / alias_matchers.md
Last active September 13, 2024 12:45
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@p1nox
p1nox / postgresql_configuration_on_ubuntu_for_rails.md
Last active July 20, 2024 11:55
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@daltonjorge
daltonjorge / rails_annotations.md
Created August 8, 2012 14:42 — forked from hakagura/rails_annotations.md
Explicações de conceitos do Rails e outras infos úteis.

Active Record

É um design pattern que o Rails implementa a partir da gem ActiveRecord.

Serve para conectar a camada Model da aplicação com tabelas do database, para assim criar um modelo de domínio persistível, onde a lógica (Model) e dados (BD) são apresentados em uma única solução.

Já persiste no BD:

obj.create