Skip to content

Instantly share code, notes, and snippets.

View gist:6017
<descr>Alguma descrição desatualizada.</descr>
select id, column1, column2, column3
from tabela_exemplo
where id = ?
View generator-bean.rb
require 'rexml/document'
include REXML
doc ='ex-query-hibernate.xml') )
root = doc.root
root.each_element('//query') { |query|
name = query.elements['name'].text #vem um SEARCH_CLIENT
arr_temp = name.split('_').each { |n|
rogerleite / backup_redmine_with_mutt
Created Feb 16, 2009
Exemplo de script que faz backup do Redmine
View backup_redmine_with_mutt
DATE_BACKUP=`date +%Y%m%d`
View business_bingo.rb
@business_words = ['Sinergia','Mentalidade','Agregar','Mercado','E-mail','Follow up','Clientes','Benefício','Parceiros','Estratégia','Sistema','Rendimento','Pró-ativo','Business','Custos','Otimização','Foco','Efetivamente','A nível de','Recursos','Resultados','Paradigma','Projeto','Implementação','Integrar']
#puts @business_words
#puts '=========================================='
def generate_card number_words, number_columns
random_words = random_business_words number_words
card = []
number_lines = (number_words / number_columns)
rogerleite /
Last active Nov 30, 2021
Install Monaco font in Linux
# Install Monaco font in Linux
# Version from nullvideo
sudo mkdir -p /usr/share/fonts/truetype/ttf-monaco && \
sudo wget -O - > \
/usr/share/fonts/truetype/ttf-monaco/Monaco_Linux.ttf && \
sudo fc-cache
rogerleite / gedit-snippets-cheat-sheet-template.eruby
Created May 4, 2009
gedit-snippets-tool ... template for generating cheat sheets
View gedit-snippets-cheat-sheet-template.eruby
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xmlns="">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cheat Sheet Gedit Snippets</title>
span {
border-bottom: 1px solid;
text-align: center;
font-size: 3em;
View tdg.rb
#!/usr/bin/ruby -w
# tdg - Thread Dump Grapher (any better name?)
# Given a Java Thread Dump file as argument, it prints out
# a Grapviz (.dot) to generate a graph that shows which threads
# are waiting on others for a lock.
# (tested with a Sun JDK 1.4 thread dump)
# from:
rogerleite / oracle_export.rb
Created Oct 24, 2009
Access Oracle with jruby using JDBC. Export data to json format.
View oracle_export.rb
Requisitos Minimos para rodar este script:
#jruby 1.1 ou superior (nao testei com superior :D)
apt-get install jruby
#baixar o oracle jdbc (para o 10g, ou procure a versão que deseje) de:
#copiar o ojdbc14.jar para (usar sudo):
rogerleite /
Created Oct 27, 2009
Simple timer for Pomodoro Technique in shell script
#sudo apt-get install beep
#! /bin/sh
date >> $FTPLOG