Skip to content

Instantly share code, notes, and snippets.

View brunojabs's full-sized avatar

Bruno Gomes brunojabs

View GitHub Profile
@brunojabs
brunojabs / rocksniffer-payload.json
Last active June 1, 2020 16:06
Rocksmith rocksniffer payload example
{
"success": true,
"currentState": 4,
"memoryReadout": {
"songTimer": 25.325,
"songID": "Cus4NBWhatsUp",
"arrangementID": "7E6253C914DD4004B034149D99EF01AE",
"gameStage": "las_game",
"mode": 1,
"noteData": {
@brunojabs
brunojabs / jabs_bash_profile.bash
Created July 28, 2014 16:21
Jabs Bash Profile
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
show_git_branch() {
_branch="$(git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/')"
test -n "$_branch" && echo -e " $_branch"
}
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: 'gmail.com',
authentication: "plain",
enable_starttls_auto: true,
@brunojabs
brunojabs / rails_format_validations.rb
Last active August 29, 2015 13:57
Rails validations to email and telephone number formats
validates :zipcode, format: { with: /[0-9]{5}-[0-9]{3}/ }
validates :phone, format: { with: /\(?[0-9]{2}\)? ?[0-9]{4,5}-?[0-9]{4}/ }
validates :email, format: { with: /\A.+@.+\..+\z/ }
@brunojabs
brunojabs / postgres_configs
Last active August 29, 2015 13:57
Postgres Configs
$ sudo su postgres -c psql
$ create user user_name with password 'user_password';
$ alter user user_name superuser;
# FATAL: Peer authentication failed for user
## change local peer to MD5, line 90
$ sudo subl /etc/postgresql/9.1/main/pg_hba.conf
#!/usr/bin/env ruby
require 'digest/md5'
require 'uri'
# this is based on gravatar image API
# https://en.gravatar.com/site/implement/images/
# options :
# size : <integer> size of image
# default: <string> url of image if email not found or:
# * 404