Skip to content

Instantly share code, notes, and snippets.

View erickhaendel's full-sized avatar
🎯
Focusing

Erick Haendel erickhaendel

🎯
Focusing
View GitHub Profile
@erickhaendel
erickhaendel / import-envs.bash
Created April 8, 2022 03:36
Importar Multiplas Variaveis no Heroku
cat .env.prod | xargs heroku config:set
# Output:
# API_PORT: 3000
# API_KEY_1: ab-cd
# DB_PORT: 6379
# REDISCLOUD_URL: xxx
@erickhaendel
erickhaendel / laravel_link.md
Created September 19, 2020 23:23
Fail Link Storage Laravel
@erickhaendel
erickhaendel / Install Composer using MAMP's PHP.md
Created July 29, 2020 03:32 — forked from irazasyed/Install Composer using MAMP's PHP.md
Instructions on how to change preinstalled Mac OS X PHP to MAMP's PHP Installation and then install Composer Package Management

Change default Mac OS X PHP to MAMP's PHP Installation and Install Composer Package Management


Instructions to Change PHP Installation


First, Lets find out what version of PHP we're running (To find out if it's the default version).

To do that, Within the terminal, Fire this command:

which php

@erickhaendel
erickhaendel / gist:94129ef93e1be7483ba392acd8e9d64a
Created July 29, 2020 00:56 — forked from bravo-kernel/gist:136ad75e3430452e3321
Nginx virtual host site configuration file for CakePHP3.x
#
# Cakebox-generated Nginx virtual host using generic template.
#
server {
listen 80;
server_name www.cake3.app;
rewrite ^(.*) http://cake3.app$1 permanent;
}

OSRM North America route server on EC2

Overview

OSRM route server is an extremely useful tool for getting the driving distance/time through multiple locations. The route server requires data that has to be downloaded and processsed before it can be used to serve routes from.

Processing OSRM data for large region like North America can be a real challenge due to memory and disk size requirements. It's also really time consuming. If you cut and try from scratch, you will repeatedly run into some constraints and fail after hours of running.

The following are summary notes from trying this with eventual success.

@erickhaendel
erickhaendel / auto.js
Last active April 7, 2020 20:51
Gamersclub medalhas
// COLOCAR DENTRO DA LISTA (LIST) DE CODIGOS SEPARADOS POR VIRGULA E ENTRE ASPAS
// EX:
// var list = ['CODE_1' , 'CODE_2' , 'CODE_3']
var list = [
];
function sleep(ms) {
@erickhaendel
erickhaendel / gist:1c43c58c880468467dd5c8528f976e7f
Last active March 26, 2020 02:44
Generate Release/Debug Keystores.md

Android: Generate Release/Debug Keystores

DEBUG RELEASE ANDROID KEYSTORE

Generate Keystores

To generate keystores for signing Android apps at the command line, use:

$ keytool -genkey -v -keystore my-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000

A debug keystore which is used to sign an Android app during development needs a specific alias and password combination as dictated by Google. To create a debug keystore, use:

@erickhaendel
erickhaendel / virtual_host_mamp.md
Last active March 14, 2020 20:10
Virtual Host - MAMP

While googling, I found these steps to easily create virtual hosts on MAMP:

Open your console in mac and edit your hosts file like this

sudo vim /etc/hosts

This opens a system file that contains the following line:

Olá desenvolvedor(a), ter um certificado SSL em um ambiente de desenvolvimento local, é um requisito para a realização de testes em algumas API's de intermediação de pagamento, como por exemplo o Pagseguro. A configuração do ambiente utilizando o Xampp e o Google Chrome era realativamente simples, com meia dúzia de comandos no Prompt você já estava com seu localhost respondendo à partir da requisição https. O problema é que à partir da versão 58 do Chrome os processos anteriores deixaram de funcionar, o que deixou muita gente de cabelo em pé.
Isso acontece porque, à partir da versão 58, o Chrome passa a não reconhecer certificados SSL assinados à partir do CN (Common Name), e reconhecer apenas certificados assinados à partir do SAN (Subject Alternative Name).
Depois de muita pesquisa, em foruns e sites especializados, encontrei uma forma bem simples de se instalar o certificado. Por enquanto testei apenas no Windows, porém em breve vou testar também no Linux! Então vamos lá.
O primeiro passo é baixar e ins
@erickhaendel
erickhaendel / generate-apk-debug.md
Last active August 29, 2023 15:25
Generate APK debug in React Native

Please follow those steps.

Bundle your js:

  • if you have index.android.js in project root then run
  react-native bundle --dev false --platform android --entry-file index.android.js --bundle-output ./android/app/build/intermediates/assets/debug/index.android.bundle --assets-dest ./android/app/build/intermediates/res/merged/debug