Skip to content

Instantly share code, notes, and snippets.

View tiagopassinato's full-sized avatar

Tiago Passinato tiagopassinato

  • Onyx Private
  • Boca Raton, FL, USA
  • 08:56 (UTC -04:00)
View GitHub Profile

Keybase proof

I hereby claim:

  • I am tiagopassinato on github.
  • I am tiagopassinato (https://keybase.io/tiagopassinato) on keybase.
  • I have a public key ASAg0YMgervOGTPEuSwZtXy2LWRLKi7a0L9GggShHaWZpQo

To claim this, I am signing this object:

@tiagopassinato
tiagopassinato / countries_postal_codes.json
Last active September 27, 2017 18:28
List of all countries, with or without postal code
[
{ "name": "Afghanistan", "code": "AF", "postal": true },
{ "name": "Åland Islands", "code": "AX", "postal": true },
{ "name": "Albania", "code": "AL", "postal": true },
{ "name": "Algeria", "code": "DZ", "postal": true },
{ "name": "American Samoa", "code": "AS", "postal": true },
{ "name": "AndorrA", "code": "AD", "postal": true },
{ "name": "Angola", "code": "AO", "postal": false },
{ "name": "Anguilla", "code": "AI", "postal": true },
{ "name": "Antarctica", "code": "AQ", "postal": true },
@tiagopassinato
tiagopassinato / async-lock.js
Last active August 27, 2022 07:41
NodeJS Async-lock example
/**
* Preventing dead-locks, using async-lock by key
*/
var AsyncLock = require('async-lock');
var lock = new AsyncLock();
function operation(id) {
console.log(id + " calling operation");
lock.acquire(id, function(done) {
@tiagopassinato
tiagopassinato / restlog.php
Last active April 28, 2016 14:50
This little script logs all requests to a text file. (Useful for Restler and other scripts)
<?php
/**
* Logs all requests (Post, Json, etc.)
*/
$logFile = '../logs/flow.log';
$postdata = $_SERVER['REQUEST_URI']."\n".file_get_contents('php://input');
if($_POST)
@tiagopassinato
tiagopassinato / add_vhost.sh
Last active September 21, 2015 21:20
Quickly add apache vhost
#!/bin/bash
echo "Creating VHOST $1"
echo "Creating folder /home/sites/$1"
mkdir /home/sites/$1
echo "Log dir & Public HTML"
mkdir /home/sites/$1/logs
mkdir /home/sites/$1/htdocs
mkdir /home/sites/$1/cgi-bin
echo "VHOST Files"