Skip to content

Instantly share code, notes, and snippets.

View danielpereirabp's full-sized avatar

Daniel Pereira danielpereirabp

View GitHub Profile
@danielpereirabp
danielpereirabp / sublime_license
Created June 30, 2015 12:56
sublime text 2.0.2
----- BEGIN LICENSE -----
Andrew Weber
Single User License
EA7E-855605
813A03DD 5E4AD9E6 6C0EEB94 BC99798F
942194A6 02396E98 E62C9979 4BB979FE
91424C9D A45400BF F6747D88 2FB88078
90F5CC94 1CDC92DC 8457107A F151657B
1D22E383 A997F016 42397640 33F41CFC
E1D0AE85 A0BBD039 0E9C8D55 E1B89D5D
@danielpereirabp
danielpereirabp / .bash_profile
Created July 13, 2015 17:57
Color Git Terminal
function git_branch_name() {
git branch 2>/dev/null | grep -e '^*' | sed -E 's/^\* (.+)$/(\1) /'
}
function show_colored_git_branch_in_prompt() {
PS1="\[\033[38m\]\h:\[\033[032m\]\W\[\033[31m\]\$(git_branch_name)\[\033[m\]$ "
}
show_colored_git_branch_in_prompt
### USAGE
###
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4
### ./ElasticSearch.sh will fail because no version was specified (exit code 1)
###
### CLI options Contributed by @janpieper
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch
### ElasticSearch version
@danielpereirabp
danielpereirabp / nginx
Last active August 29, 2015 14:25
Comandos úteis
# Testa as configurações
nginx -t
# Verifica se a porta está sendo usada
netstat -napl | grep 9001
# Testa a conexão com a porta
nc -vz localhost 9003

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

@danielpereirabp
danielpereirabp / 0_reuse_code.js
Last active August 29, 2015 14:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@danielpereirabp
danielpereirabp / php5-5.6
Created July 20, 2015 17:02
How to setup / install PHP 5.6 on Ubuntu 14.04 LTS
1. Add PHP 5.6 package sources to your system:
sudo add-apt-repository ppa:ondrej/php5-5.6
sudo apt-get update
sudo apt-get install python-software-properties
2. Update
sudo apt-get update
@danielpereirabp
danielpereirabp / es.sh
Last active August 29, 2015 14:26 — forked from Globegitter/es.sh
Easy install for elasticsearch on Ubuntu 14.04
cd ~
##If you want to install OpenJDK
#sudo apt-get update
#sudo apt-get install openjdk-8-jre-headless -y
###Or if you want to install Oracle JDK, which seems to have slightly better performance
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
@danielpereirabp
danielpereirabp / Laravel 5.1
Created August 4, 2015 12:40
Comandos de console
php artisan make:model Model -m
php artisan migrate
php artisan migrate:refresh --seed
@danielpereirabp
danielpereirabp / gist:3426c43403add810c5ab
Last active August 29, 2015 14:27 — forked from danpette/gist:a4f9cd207f669f99b882
Ubuntu 14.04 Setup: nginx + varnish + memcached + php5.6 + mysql5.6 + Mongodb 2.6.7 + phpmyadmin
# Basic
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install htop
sudo apt-get install curl
#MySQL
sudo apt-get install mysql-server-5.6 php5-mysql
sudo mysql_install_db
sudo /usr/bin/mysql_secure_installation