Skip to content

Instantly share code, notes, and snippets.

View danieljoppi's full-sized avatar

Daniel Henrique Joppi danieljoppi

  • Santa Catarina, Brazil
View GitHub Profile
// Originally generated from...
// 1) sql-bubble.txt (from sqlite.org)
// 2) ./sql-bubble.rb sql-bubble.txt > tmp/rules.rb
// 3) ./bubble-to-pegjs.rb tmp/rules.rb bubble-to-pegjs_ex.rb > tmp/sql.pegjs
//
// Then, manually edited for pegjs suitability.
//
// Rules with indentation or with comments have manual edits.
//
start = value
@danieljoppi
danieljoppi / installing_cassandra.md
Created February 3, 2016 13:31 — forked from hkhamm/installing_cassandra.md
Installing Cassandra on Mac OS X

Installing Cassandra on Mac OS X

Install Homebrew

Homebrew is a great little package manager for OS X. If you haven't already, installing it is pretty easy:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
@danieljoppi
danieljoppi / storeImgInMongoWithMongoose.js
Created February 3, 2017 13:56 — forked from aheckmann/storeImgInMongoWithMongoose.js
store/display an image in mongodb using mongoose/express
/**
* Module dependencies
*/
var express = require('express');
var fs = require('fs');
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// img path
@danieljoppi
danieljoppi / redis-promisify.js
Last active October 2, 2018 20:49
Node Redis with promise
const Redis = require('redis');
const redis = new Proxy(Redis.createClient({
port: config.memoryPort,
host: config.memoryHost
}), {
get(redis, name) {
let target = redis[name];
if ('function' !== typeof target) {
return target;
"AC","69900-000 a 69999-999"
"Acrelândia","69945-000 a 69949-999"
"Assis Brasil","69935-000 a 69939-999"
"Brasiléia","69932-000 a 69933-999"
"Bujari","69926-000 a 69926-999"
"Capixaba","69931-000 a 69931-999"
"Cruzeiro do Sul","69980-000 a 69981-999"
"Epitaciolândia","69934-000 a 69934-999"
"Feijó","69960-000 a 69969-999"
[
{"stateCode": 52, "state": "GO", "code": 5200050, "name": "Abadia de Goiás", "slug": "abadia-de-goias", "groupCode": 52010},
{"stateCode": 31, "state": "MG", "code": 3100104, "name": "Abadia dos Dourados", "slug": "abadia-dos-dourados", "groupCode": 31019},
{"stateCode": 52, "state": "GO", "code": 5200100, "name": "Abadiânia", "slug": "abadiania", "groupCode": 52012},
{"stateCode": 31, "state": "MG", "code": 3100203, "name": "Abaeté", "slug": "abaete", "groupCode": 31024},
{"stateCode": 15, "state": "PA", "code": 1500107, "name": "Abaetetuba", "slug": "abaetetuba", "groupCode": 15011},
{"stateCode": 23, "state": "CE", "code": 2300101, "name": "Abaiara", "slug": "abaiara", "groupCode": 23033},
{"stateCode": 29, "state": "BA", "code": 2900108, "name": "Abaíra", "slug": "abaira", "groupCode": 29023},
{"stateCode": 29, "state": "BA", "code": 2900207, "name": "Abaré", "slug": "abare", "groupCode": 29005},
{"stateCode": 41, "state": "PR", "code": 4100103, "name": "Abatiá", "slug": "abatia", "gro
[
{"code": 11, "name": "Rondônia", "slug": "rondonia", "sigla": "RO", "capitalCityCode": 1100205},
{"code": 12, "name": "Acre", "slug": "acre", "sigla": "AC", "capitalCityCode": 1200401},
{"code": 13, "name": "Amazonas", "slug": "amazonas", "sigla": "AM", "capitalCityCode": 1302603},
{"code": 14, "name": "Roraima", "slug": "roraima", "sigla": "RR", "capitalCityCode": 1400100},
{"code": 15, "name": "Pará", "slug": "para", "sigla": "PA", "capitalCityCode": 1501402},
{"code": 16, "name": "Amapá", "slug": "amapa", "sigla": "AP", "capitalCityCode": 1600303},
{"code": 17, "name": "Tocantins", "slug": "tocantins", "sigla": "TO", "capitalCityCode": 1721000},
{"code": 21, "name": "Maranhão", "slug": "maranhao", "sigla": "MA", "capitalCityCode": 2111300},
{"code": 22, "name": "Piauí", "slug": "piaui", "sigla": "PI", "capitalCityCode": 2211001},