Skip to content

Instantly share code, notes, and snippets.


Gabriel Lacerda gabriellacerda

View GitHub Profile
gabriellacerda / Exemplo completo
Created Oct 24, 2018 — forked from luizgpsantos/Exemplo completo
Analyzer para plural e acentos no elasticsearch
View Exemplo completo
//Cria o índice especificando quais os analyzer ele tem
//Além disso especifica que o campo "titulo" do tipo "seu_tipo" utiliza o analyzer recem criado
curl -XPUT "http://localhost:9200/my_index" -d'
"settings": {
"analysis": {
"analyzer": {
"analyzer_customizado": {
"tokenizer": "standard",

Generating Facebook hash key for in app login

keytool -exportcert -alias androiddebugkey -keystore /Users/agenciaccm/Sites/acaiteria/ionic/acaiteria-key.keystore | openssl sha1 -binary | openssl base64
gabriellacerda /
Created Feb 2, 2018 — forked from anonymous/
Scotch Box Change PHP Repository
#!/usr/bin/env bash
# Update PHP Repo
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# Remove PHP 5.6
sudo apt-get --remove purge -y php5 php5-cli php5-curl php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-readline php5-sqlite php5-cgi php5-common php5-fpm php5-imagick php5-json php5-memcache php5-mongo php5-pgsql php5-redis php-pear
sudo apt-get -y autoremove
gabriellacerda /
Created Jan 19, 2018 — forked from pketh/
Promises in Coffeescript
# Create a promise:
myCoolPromise = new Promise (resolve, reject) ->
# do a thing
success = true
if success
resolve 'stuff worked'
reject Error 'it broke'

.git-ftp-ignore | Conteúdo abaixo

bower_components/* node_modules/*

.git-ftp-include | Conteúdo abaixo


Dentro da pasta .git, checar arquivo config

View WP .htacess cache controll
#Força a utilizar Cache-Control e Expires header
<IfModule mod_headers.c>
Header unset ETag
FileETag None
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Html

Change from custom default file to normal

sudo mv /etc/nginx/sites-available/default /etc/nginx/sites-available/default-3 && sudo mv /etc/nginx/sites-available/default-2 /etc/nginx/sites-available/default

Edit nginx file

sudo nano /etc/nginx/sites-available/default

Check nginx file

gabriellacerda /
Last active Jul 5, 2017
Google cloud vms commands

Google Cloud vm details

To become another non-root user on a GCE VM, first become root via password-less sudo (since that's how sudo is configured on GCE VM images):

sudo su -

and then switch to the user you want to become or run a command as another use, e.g., in your case, that's:

sudo -i -u gabriellacerdadesign