Skip to content

Instantly share code, notes, and snippets.

Avatar

Gabriel Lacerda gabriellacerda

View GitHub Profile
@gabriellacerda
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",
View generate-hash-key-facebook.md

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
gabriellacerda / provisioner-php5.5.sh
Created Feb 2, 2018 — forked from anonymous/provisioner-php5.5.sh
Scotch Box Change PHP Repository
View provisioner-php5.5.sh
#!/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
gabriellacerda / 1-promises.coffee
Created Jan 19, 2018 — forked from pketh/1-promises.coffee
Promises in Coffeescript
View 1-promises.coffee
# Create a promise:
myCoolPromise = new Promise (resolve, reject) ->
# do a thing
success = true
if success
resolve 'stuff worked'
else
reject Error 'it broke'
View set-robot-git-ftp.md

.git-ftp-ignore | Conteúdo abaixo

bower_components/* node_modules/*

.git-ftp-include | Conteúdo abaixo

vendor/:composer.lock

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
</IfModule>
FileETag None
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
ExpiresByType text/cache-manifest "access plus 0 seconds"
# Html
View lets-encrypt-commands.md

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
gabriellacerda / google-cloud-commands.md
Last active Jul 5, 2017
Google cloud vms commands
View google-cloud-commands.md

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