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
-- get all latest the finished progresses of all individuals | |
SELECT * | |
FROM progresses pr | |
WHERE id = ( | |
SELECT id | |
FROM progresses p | |
WHERE p.individual_id = pr.individual_id AND p.procedure_id = pr.procedure_id AND p.finished | |
ORDER BY p.created_at DESC LIMIT 1 ) | |
ORDER BY pr.created_at DESC; |
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
var date = new Date(); | |
var firstDay = new Date(date.getFullYear(), date.getMonth(), 1); | |
var lastDay = new Date(date.getFullYear(), date.getMonth() + 1, 0); |
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
Baixe o tema Seti UI, coloque dentro da pasta package do sublime text e renomei a pasta para "Theme - Soda" para adicionar icones ao tema soda dark |
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
wget http://dl.dropbox.com/u/26209128/mac_fonts.tar.gz | |
tar zxvf mac_fonts.tar.gz | |
sudo mv fonts /usr/share/fonts/ | |
sudo fc-cache -f -v |
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
{ | |
"color_scheme": "Packages/Boxy Theme/schemes/Boxy Tomorrow.tmTheme", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"font_face": "monaco", | |
"font_size": 10, | |
"rulers": [122], | |
"translate_tabs_to_spaces": true, | |
"trim_trailing_white_space_on_save": true, | |
"tab_size": 2, |
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
Listando Processo no Linux | |
ps -f -u postgres | |
REF -> [http://canaltech.com.br/tutorial/linux/conheca-6-comandos-para-gerenciar-processos-do-linux/] | |
Listando endereços TCP/IP e portas do PostgreSQL | |
sudo lsof -n -u postgres |grep LISTEN | |
REF -> [http://www.vivaolinux.com.br/dica/O-comando-lsof] |
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
class Hash | |
module Using | |
def using(&block) | |
values = block.parameters.map do |type, name| | |
self[name] | |
end | |
block.call(*values) | |
end | |
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
require "rubygems" | |
require "mechanize" | |
agent = Mechanize.new | |
page = agent.get("http://esaj.tjce.jus.br/cpopg/open.do") | |
form = page.form_with(:name => "consultarProcessoForm") | |
page.form_with(:name => "consultarProcessoForm") do |form| | |
form.fields.each do |field| | |
field.value = field.options.detect { |option| option.value == "NUMPROC"}.value if field.name == "cbPesquisa" |
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
# Listar as chaves que começam com redis_user_permission | |
KEYS redis_user_permission* | |
# Listar um determinado número de elementos de uma lista (Somente para valores que sejam lista) | |
LRANGE redis_user_permission:1:engines 0 9 | |
# Obtem o valor da chave informada (Somente para valores que sejam string) | |
GET redis_user_permission:1:user_id | |
# Apaga um chave no Redis | |
DEL nome_da_chave | |
Ex. DEL redis_user_permission:1:engines |
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
psql -U postgres -h localhost base_development < ~/Desktop/dump_user-27072016 |