Skip to content

Instantly share code, notes, and snippets.

View josecoelho's full-sized avatar

José Coelho josecoelho

View GitHub Profile
@josecoelho
josecoelho / server.sh
Last active August 29, 2015 14:01
BASH Script: Add host to /etc/hosts, exec PHP dev server, Remove host from /etc/hosts
# !/bin/sh
SITE_DOMAIN="test.production.url";
HOSTS_LINE="127.0.0.1 $SITE_DOMAIN";
COMMENTED_HOSTS_LINE="# $HOSTS_LINE"
echo "Add $SITE_DOMAIN to your /etc/hosts";
sudo -- sh -c "echo '$HOSTS_LINE' >> /etc/hosts";
echo "Starting server";
#Sublime Text 3 Configs
##Plugins
- "Alignment"
- "Better JavaScript"
- "EditorConfig"
- "Emmet"
- "Gist"
- "JsFormat"
- "Sass"
def create_invoices
interval = 1.month
cicle = 12 #quantidade desejada
start_date = Date.today #data inicial
current_date = start_date
cicle.times do
# criar o que você precisa, alguns exemplos:
# invoices.create(date: current_date, outro_campo: "Algum outro valor")
# invoices << Invoice.create(date: current_date)
@josecoelho
josecoelho / INSTALL CENTOS.md
Last active February 24, 2023 18:34
Load testing using WRK2 + LUA + Redis

Lua 5.1 installed already

Installing luarocks

# yum install lua-devel
# wget http://luarocks.org/releases/luarocks-2.3.3.tar.gz
# tar -xzvf luarocks-2.2.1.tar.gz
# cd luarocks-2.2.1
# ./configure
# make bootstrap