Skip to content

Instantly share code, notes, and snippets.

😃
Coding!

Rhuan rhuanbarreto

😃
Coding!
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
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(
rootReducer,
composeEnhancers(
@rhuanbarreto
rhuanbarreto / command.sh
Created Nov 16, 2018
Delete all local untracked branches from git
View command.sh
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
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;
ssl_ciphers ECDH+AESGCM:ECDH+AES256:ECDH+AES128:DHE+AES128:!ADH:!AECDH:!MD5;
@rhuanbarreto
rhuanbarreto / copy-docker.sh
Created Apr 12, 2018
Import Database from Backup File on SQL Server for Linux / Docker
View copy-docker.sh
# 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
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
AZURE_ACCOUNT_NAME=storageaccountname
AZURE_ACCOUNT_KEY=storageaccountkey
PASSPHRASE=passphrase_for_GPG_encryption
@rhuanbarreto
rhuanbarreto / install_homebrew.sh
Created Apr 1, 2018
Install Homebrew on MacOS X
View install_homebrew.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@rhuanbarreto
rhuanbarreto / masks.js
Created Jan 14, 2017
Máscaras comuns pt-br para jQuery MaskedInput
View masks.js
jQuery(function($) {
$('#cnpj,.cnpj').mask("99.999.999/9999-99");
$('#cep,.cep').mask("99.999-999");
$('#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 = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 || (function(p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification);
if (isFirefox || isSafari) {
$('#prazo,.prazo').mask("99/99/9999");
@rhuanbarreto
rhuanbarreto / install.sh
Created Jan 9, 2018
Install Ruby on Rails on Mac OS
View install.sh
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
rhuanbarreto / alfresco-ubuntu-install.sh
Last active Jan 5, 2018
Install Alfresco Community on Ubuntu Server Command Line
View alfresco-ubuntu-install.sh
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/libGL.so.1 ./libGL.so.1
cd ~
curl -O http://eu.dl.alfresco.com.s3.amazonaws.com/release/community/201707-build-00028/alfresco-community-installer-201707-linux-x64.bin
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
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));
}).trigger('blur');
You can’t perform that action at this time.