Skip to content

Instantly share code, notes, and snippets.

View danielpereirabp's full-sized avatar

Daniel Pereira danielpereirabp

View GitHub Profile
@danielpereirabp
danielpereirabp / git.txt
Created September 28, 2016 11:35 — forked from armoucar/git.txt
comandos git
Instalação do GIT no ubuntu:
sudo apt-get install git-core git-svn ssh gitk
ssh-keygen -t rsa
git config --global user.name "Arthur Moura Carvalho"
git config --global user.email "armoucar@gmail.com"
git config --global color.status "auto"
git config --global color.branch "auto"
git config --global color.interactive "auto"
git config --global color.diff "auto"
@danielpereirabp
danielpereirabp / busy.interceptor.js
Created February 19, 2016 16:21 — forked from jonaszuberbuehler/busy.interceptor.js
http interceptor using angular-busy to show loading indicator
(function () {
'use strict';
angular
.module('app')
.config(['$httpProvider', function ($httpProvider) {
$httpProvider.interceptors.push('busyInterceptor');
}])
.factory('busyInterceptor', busyInterceptor);
@danielpereirabp
danielpereirabp / README.txt
Last active September 18, 2015 17:20 — forked from mattweber/README.txt
ElasticSearch Multi-Select Faceting Example
This is an example how to perform multi-select faceting in ElasticSearch.
Selecting multiple values from the same facet will result in an OR filter between each of the values:
(facet1.value1 OR facet1.value2)
Faceting on more than one facet will result in an AND filter between each facet:
(facet1.value1 OR facet1.value2) AND (facet2.value1)
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh).
@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
@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 / 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

#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

### 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