Skip to content

Instantly share code, notes, and snippets.


Rhuan rhuanbarreto

Block or report user

Report or block rhuanbarreto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rhuanbarreto / store.js
Created Jan 9, 2019
Configure Redux DevTools with Redux Offline
View store.js
import { createStore, compose } from "redux";
import rootReducer from "./reducers";
import { offline } from '@redux-offline/redux-offline';
import config from '@redux-offline/redux-offline/lib/config';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
export default createStore(
rhuanbarreto /
Created Nov 16, 2018
Delete all local untracked branches from git
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
rhuanbarreto / nginx.conf
Created May 11, 2018
Jenkins configuration for Nginx reverse proxy
View nginx.conf
http {
# SSL Settings
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 180m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_tickets off;
ssl_certificate /certs/cert.crt;
ssl_certificate_key /certs/cert.key;
ssl_prefer_server_ciphers on;
rhuanbarreto /
Created Apr 12, 2018
Import Database from Backup File on SQL Server for Linux / Docker
# Copy backup file to Docker Container
# Remember to name your container with the --name parameter on docker start, so you can
# replace the SQL_Server name on the following command.
# Remember also to change the backup file path.
docker cp ~/database.bak SQL_Server:/var/opt/mssql/data/
rhuanbarreto / environment
Created Apr 10, 2018
Install and use Duplicity for Azure backup on Ubuntu Linux
View environment
# Add this lines to the /etc/environment file. Change account name key and passphrase according to your settings
rhuanbarreto /
Created Apr 1, 2018
Install Homebrew on MacOS X
/usr/bin/ruby -e "$(curl -fsSL"
rhuanbarreto /
Created Jan 9, 2018
Install Ruby on Rails on Mac OS
brew install rbenv ruby-build
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile
rbenv install 2.3.6
rbenv global 2.3.6
ruby -v
gem install rails -v 5.0.6
rbenv rehash
rails -v
rhuanbarreto /
Last active Jan 5, 2018
Install Alfresco Community on Ubuntu Server Command Line
sudo apt-get update
sudo apt-get install -y --no-install-recommends libice6 libsm6 libxt6 libxrender1 libfontconfig1 libcups2 libglu1-mesa libcairo2 libgl1-mesa-glx
cd /usr/lib/x86_64-linux-gnu
sudo ln -s mesa/ ./
cd ~
curl -O
chmod +x alfresco-community-installer-201707-linux-x64.bin
./alfresco-community-installer-201707-linux-x64.bin --alfresco_admin_password <good admin password> --mode unattended --baseunixservice_install_as_service 1 --prefix /opt/alfresco
rhuanbarreto / script.js
Created Jan 28, 2017
Floating Labels for BootSwatch Paper
View script.js
$('.form-control').on('focus blur', function (e) {
$(this).parents('.form-group').toggleClass('focused', (e.type === 'focus' || this.value.length > 0));
rhuanbarreto / masks.js
Created Jan 14, 2017
Máscaras comuns pt-br para jQuery MaskedInput
View masks.js
jQuery(function($) {
$('#telefone-fixo,.telefone-fixo').mask("(99) 9999-9999");
$('#telefone-celular,.telefone-celular').mask("(99) 99999-9999");
// Se for um campo input do tipo date, mostrar máscara somente no Safari e Firefox pra evitar problemas com validação e mobile
var isFirefox = typeof InstallTrigger !== 'undefined';
var isSafari ='Constructor') > 0 || (function(p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification);
if (isFirefox || isSafari) {
You can’t perform that action at this time.