Skip to content

Instantly share code, notes, and snippets.

View rhuanbarreto's full-sized avatar
😃
Coding @t60digital!

Rhuan Barreto rhuanbarreto

😃
Coding @t60digital!
View GitHub Profile
@rhuanbarreto
rhuanbarreto / store.js
Created January 9, 2019 04:13
Configure Redux DevTools with Redux Offline
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 / nginx.conf
Created May 11, 2018 09:20
Jenkins configuration for Nginx reverse proxy
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 / environment
Created April 10, 2018 01:02
Install and use Duplicity for Azure backup on Ubuntu Linux
# 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 April 1, 2018 14:20
Install Homebrew on MacOS X
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
@rhuanbarreto
rhuanbarreto / masks.js
Created January 14, 2017 13:05
Máscaras comuns pt-br para jQuery MaskedInput
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 January 9, 2018 10:08
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
rhuanbarreto / alfresco-ubuntu-install.sh
Last active January 5, 2018 14:04
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/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 January 28, 2017 18:41
Floating Labels for BootSwatch Paper
$('.form-control').on('focus blur', function (e) {
$(this).parents('.form-group').toggleClass('focused', (e.type === 'focus' || this.value.length > 0));
}).trigger('blur');
@rhuanbarreto
rhuanbarreto / snippets.cson
Created January 14, 2017 13:01
Fast Snippets for Atom PHP
'.text.html':
'Base URL':
'prefix': 'base_url'
'body': '<?=base_url()?>$1'
'Short Echo':
'prefix': 'qw'
'body': '<?=$1?>'
'Code Block':
'prefix': 'qa'
'body': '<?php $1 ?>'