Skip to content

Instantly share code, notes, and snippets.

View handersonbf's full-sized avatar
🏠
Working from home

Handerson Frota handersonbf

🏠
Working from home
View GitHub Profile
@handersonbf
handersonbf / MySQL Remote Permissions
Created March 17, 2011 00:15
MySQL Remote Permissions
root@webby4751:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 295
Server version: 5.0.67-0ubuntu6 (Ubuntu)
mysql> use bd
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
@handersonbf
handersonbf / instalacao e configuracao
Created May 18, 2011 20:57
Instalando, Configurando e Rodando Cucumber com JRuby no Linux
Verificar se existe o Java e Ruby.
Java
java -version
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode)
Ruby
ruby -v
@handersonbf
handersonbf / mysqlCaseSensitivity
Created May 20, 2011 14:12
Case Sensitivity no MySQL
Procure a pasta de instalação do MySQL.
No linux fica em etc/mysql
Abra o arquivo my.cnf como root e procure por essa trecho:
[mysqld]
#
# * Basic Settings
#
@handersonbf
handersonbf / comandosGIT.git
Last active October 2, 2015 16:58
Comandos GIT
git shortlog -s | sort -rn | nl
Sincronizando master com outro branch.
no branch master, execute:
git rebase outroBranch
Ou para deixar a árvore de commits limpa.
git checkout master
git pull origin master
@handersonbf
handersonbf / configuracao tomcat otimizacao
Created June 13, 2011 18:49
Otimizar tomcat NIOProtocol
<Connector port="80" protocol="org.apache.coyote.http11.Http11NioProtocol"
connectionTimeout="2000" maxThreads="10000" acceptCount="5000"
acceptorThreadCount="2" socket.directBuffer="false"/>
@handersonbf
handersonbf / json isempty
Created July 15, 2011 12:59
Verificar objeto json vazio
function isEmpty(obj) {
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
return false;
}
}
return true;
};
@handersonbf
handersonbf / setarFocoJavaScript
Created July 18, 2011 18:25
JavaScript para avançar e voltar em campos inputs
/**
* Verifica se a a tecla que foi digitada foi o tab ou o enter, e assim dispara
* o evento de blur no elemento que chamou.<br>
* Recebe um novo parametro para ao digitar HOME ou Seta para cima voltar para o campo desejado.
*
* @author Handerson Frota [ handersonbf@gmail.com ]
*
* @param {Object}
* e evento
* @param {Object}
@handersonbf
handersonbf / rspec
Created August 8, 2011 19:03
Comandos RSpec
rspec spec/model/nome_spec.rb -e "nome do teste"
@handersonbf
handersonbf / arquivo.java
Created September 6, 2011 20:35
sessao.java
package br.com.itc.service.impl;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
@handersonbf
handersonbf / env.rb
Created October 24, 2011 15:18
env.rb
# IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*.rb
# files.
ENV["RAILS_ENV"] ||= "test"
require File.expand_path(File.dirname(__FILE__) + '/../../config/environment')
require 'cucumber/formatter/unicode' # Remove this line if you don't want Cucumber Unicode support