Skip to content

Instantly share code, notes, and snippets.

View gustavopradoreis's full-sized avatar
🎯
Focusing

Gustavo Prado Reis gustavopradoreis

🎯
Focusing
View GitHub Profile
@gustavopradoreis
gustavopradoreis / n-path.js
Last active August 26, 2022 16:30
n-path algorithm
import fs from 'fs';
const pathsContent = getPathsFile('paths2.txt').replace(/(\r\n|\n|\r)/gm, ",\n");
function solution(path_size) {
const pathsArray = pathsContent.split("\n");
const higherOcurrence = {
path: null,
ocurrencies: 0,
}
@gustavopradoreis
gustavopradoreis / icu-config
Created September 20, 2020 19:55 — forked from jasny/icu-config
ICU 66.1 for Ubuntu 20.04
#!/bin/sh
## -*-sh-*-
#set -x
# BEGIN of icu-config-top
# Copyright (C) 2016 and later: Unicode, Inc. and others.
# License & terms of use: http://www.unicode.org/copyright.html
#******************************************************************************
# Copyright (C) 1999-2013, International Business Machines
# Corporation and others. All Rights Reserved.
#******************************************************************************
@gustavopradoreis
gustavopradoreis / postgres_queries_and_commands.sql
Created August 14, 2020 01:56 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
#!/bin/sh -e
usage() {
echo "OVERVIEW: Build apps according to BUILD_ENV value. Meant to be used for Heroku deployment"
exit
}
if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
usage
fi
@gustavopradoreis
gustavopradoreis / readme.md
Last active August 29, 2015 14:15
Integração Mailchimp

Como fazer integração do CakePHP com Mailchimp

Em um projeto que trabalhei, o cliente tinha um espaço no site para cadastro de newsletter, dessa forma ele gostaria de fazer automaticamente esse cadastro em suas listas no Mailchimp para não ter que ficar importando uma lista nova de e-mails sempre.

Dai surgiu a necessidade de pesquisar um pouco e encontrar diversas maneiras de fazer isso, algumas que até já não funcionam mais devido a versões.. Vou mostrar aqui como funcionou pra mim.

Optei por usar um plugin do Mark S. Existe uma pequena documentação junto ao repositório do github, porém achei bastante confuso..

Instalação