Skip to content

Instantly share code, notes, and snippets.

View lpirola's full-sized avatar

Lucas Pirola Dias lpirola

  • São Paulo, Brazil
View GitHub Profile
@lpirola
lpirola / main.go
Created January 13, 2018 00:20 — forked from enricofoltran/main.go
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@lpirola
lpirola / README.md
Created September 25, 2017 03:17 — forked from Dr-Nikson/README.md
Auth example (react + redux + react-router)
@lpirola
lpirola / codes.csv
Created June 14, 2017 20:18 — forked from halhen/codes.csv
The people who keep us company - dataviz
We can make this file beautiful and searchable if this error is corrected: It looks like row 8 should actually have 1 column, instead of 2 in line 7.
code;name
01;Personal Care Activities
0101;Sleeping
0102;Grooming
0103;Health-related self care
0104;Personal Activities
0105;Personal Care Emergencies
0199;Personal care, n.e.c.*
02;Household Activities
0201;Housework
@lpirola
lpirola / postgres-cheatsheet.md
Created April 2, 2017 20:56 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@lpirola
lpirola / Dockerfile
Created March 28, 2017 15:01 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@lpirola
lpirola / track.js
Created March 28, 2017 01:56 — forked from nioufe/track.js
import LogmaticJs from 'logmatic-js';
const track = function (verb) {
// Event fields
const _verb = verb;
let _object = null;
let _target = null;
let _start = null;
@lpirola
lpirola / 1_phantomErrors.js
Created March 22, 2017 20:10 — forked from artjomb/1_phantomErrors.js
Error event handlers for PhantomJS and CasperJS: PhantomJS and CasperJS don't show errors on the page by default. This can give clues as to what did go wrong.
var page = require('webpage').create(),
url = 'http://example.com/';
// Put the event handlers somewhere in the code before the action of
// interest (opening the page in question or clicking something)
// http://phantomjs.org/api/webpage/handler/on-console-message.html
page.onConsoleMessage = function(msg, lineNum, sourceId) {
console.log('CONSOLE: ' + msg + ' (from line #' + lineNum + ' in "' + sourceId + '")');
};

Reduce boilerplate in Redux

  • Create actions similar to Flummox.
  • Generate action ids.
  • Supports actions with decorators, promises, and therefore ES7 async.

Three.JS Cubes

@lpirola
lpirola / install-delibera.sh
Last active June 29, 2016 14:49
Rápida forma de instalar wordpress e utiliza-lo com o plugin do delibera
mkdir desafio-delibera
cd desafio-delibera/
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
php wp-cli.phar --info
chmod +x wp-cli.phar
# sudo mv wp-cli.phar /usr/local/bin/wp
mv wp-cli.phar wp
wp core download
wp core config --dbname=delibera --dbuser=root
wp core install --path=./ --url=http://localhost:8080 --title=teste-delibera --admin_user=root --admin_password=123 --skip-email [email protected]