Skip to content

Instantly share code, notes, and snippets.

View lpirola's full-sized avatar

Lucas Pirola Dias lpirola

  • São Paulo, Brazil
  • 05:52 (UTC -03:00)
View GitHub Profile
@lpirola
lpirola / create-mint-sh
Created April 17, 2018 13:22 — forked from gildas/create-mint-sh
Create Linux Mint USB on Mac OS/X
#! /usr/bin/env bash
# Insert a USB key.
# if needed initialize it with MS/DOS FAT and MBR
# Download the Mint ISO image
# Convert the ISO -> IMG
hdiutil convert -format UDRW -o linuxmint-17.3-cinnamon-64bit linuxmint-17.3-cinnamon-64bit.iso
# Run a diskutil list to know the device for the USB key, e.g.: /dev/disk3
@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