Skip to content

Instantly share code, notes, and snippets.

View hpgsantos's full-sized avatar
💭
coding

Henrique Pires hpgsantos

💭
coding
View GitHub Profile

Look in node_modules global for exisint paths

build_command_lambda_local=$(getPathFromModulesNode mongoose,express,mongoose)
echo $build_command_lambda_local 

Recover global dir for node_modules

dev_install () {
yum -y update
yum -y upgrade
yum install -y \
wget \
gcc \
gcc-c++ \
openssl \
python27-devel \
python27-virtualenv \
@hpgsantos
hpgsantos / sql_hacks.md
Last active January 14, 2020 22:26
SQL hakcs

Vanilla

  --- Common table expression on the fly
  WITH cte_usuario AS (
    SELECT * FROM (
      VALUES  (1,GETDATE(),'Pessoa 1')
      ,       (2,GETDATE(),'Pessoa 2')
    ) a(id,created_at,name)
  ) SELECT * FROM cte_usuario CTU
@hpgsantos
hpgsantos / rpkginstall.r
Last active March 29, 2018 13:04
r_packages_install
if(!require(XML)) install.packages('XML')
if(!require(data.table)) install.packages('data.table')
if(!require(geosphere)) install.packages('geosphere')
if(!require(rgdal)) install.packages("https://cran.r-project.org/src/contrib/Archive/rgdal/rgdal_1.2-5.tar.gz",repos=NULL, method="libcurl")
if(!require(rgeos)) install.packages("https://cran.r-project.org/src/contrib/Archive/rgeos/rgeos_0.3-23.tar.gz",repos=NULL, method="libcurl")
if(!require(gdalUtils)) install.packages('gdalUtils')
##system("sudo apt-get update --fix-missing && sudo apt-get install -y libgdal-dev libproj-dev")
{
"volume_vendas": {
"userEmail": "hpgoulart@gmail.com",
"volumeVendas": 28,
"percentile": 100,
"quintile": 4
},
"valor_venda": {
"userEmail": "hpgoulart@gmail.com",
"valorVendas": 753.00,
@hpgsantos
hpgsantos / output_intent.md
Last active February 23, 2018 13:42
output_intent.md

Request

Raw POST sample as JSON

http:///parse

{"q":"quero gerar o boleto de janeiro"}
sudo apt-get install bash-completion
sudo apt-get install --reinstall bash-completion
sudo vi /etc/bash.bashrc
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/
@hpgsantos
hpgsantos / LetsEncrypt.md
Last active February 18, 2018 04:17 — forked from davestevens/LetsEncrypt.md
Let’s Encrypt setup for Apache, NGINX & Node.js

Let's Encrypt

Examples of getting certificates from Let's Encrypt working on Apache, NGINX and Node.js servers.

Obtain certificates

I chose to use the manual method, you have to make a file available to verify you own the domain. Follow the commands from running

echo "HASH1.HASH2" > static/.well-known/acme-challenge/HASH1