Skip to content

Instantly share code, notes, and snippets.

@eduardo-mior
eduardo-mior / Lista de Órgãos Emissores
Last active November 11, 2024 20:04
Lista completa de órgãos emissores de documentos de identificação.
ABNC - Academia Brasileira de Neurocirurgia
AGU - Advocacia-Geral da União
ANAC - Agência Nacional de Aviação Civil
CAER - Clube de Aeronáutica
CAU - Conselho de Arquitetura e Urbanismo
CBM - Corpo de Bombeiro Militar
CFA - Conselho Federal Administração
CFB - Conselho Federal de Biblioteconomia
CFBIO - Conselho Federal de Biologia
CFBM - Conselho Federal de Biomedicina
@eduardo-mior
eduardo-mior / Dump Lista de Órgãos Emissores
Last active August 2, 2021 12:22
Database com a lista completa de órgãos emissores de documentos de identificação.
CREATE TABLE orgao_expedidor(
id int PRIMARY KEY,
sigla varchar(8) NOT NULL,
nome varchar(128) NOT NULL,
tipo int NOT NULL -- 1 Orgão Federal -- 2 Orgão Regional -- 3 Orgão Municipal -- 4 Estrangeiro / Outro
);
CREATE INDEX idx_sigla ON orgao_expedidor (sigla);
CREATE INDEX idx_nome ON orgao_expedidor (nome) ;
/**
* Export all data from an IndexedDB database
*
* @param {IDBDatabase} idbDatabase The database to export from
* @return {Promise<string>}
*/
export function exportToJson(idbDatabase) {
return new Promise((resolve, reject) => {
const exportObject = {}
if (idbDatabase.objectStoreNames.length === 0) {
@oprudkyi
oprudkyi / DebugMailServiceProvider.php
Created April 22, 2016 03:20
laravel swift mailer logger
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Swift_Mailer;
use \Swift_Plugins_Logger;
use \Swift_Plugins_LoggerPlugin;
class DebugMailServiceProvider extends ServiceProvider implements Swift_Plugins_Logger
@chrisnew
chrisnew / postfix-wrapper.sh
Created January 21, 2015 14:18
postfix-wrapper.sh for supervisord in docker. Controls postfix as it gets controlled by supervisord.
#!/usr/bin/env bash
# postfix-wrapper.sh, version 0.1.0
#
# You cannot start postfix in some foreground mode and
# it's more or less important that docker doesn't kill
# postfix and its chilren if you stop the container.
#
# Use this script with supervisord and it will take
# care about starting and stopping postfix correctly.
#
@rgreenjr
rgreenjr / postgres_queries_and_commands.sql
Last active November 17, 2024 13:10
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%'