Skip to content

Instantly share code, notes, and snippets.

View jihonrado's full-sized avatar

Jose I. Honrado jihonrado

View GitHub Profile
@jihonrado
jihonrado / rubocop_git_hook_pre_commit.rb
Created February 22, 2016 09:50
Git pre-commit hook to execute rubocop
#!/bin/sh
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m'
# Check if rubocop is installed
rubocop -v >/dev/null 2>&1 || { echo >&2 "${RED}[Ruby Style][Fatal]: Install rubocop in your project or system"; exit 1; }
@jihonrado
jihonrado / java_random_string_generation
Created May 31, 2013 15:42
Java random string generation
public static String generateRandomString() {
return new BigInteger(130, new SecureRandom()).toString(32);
}