Skip to content

Instantly share code, notes, and snippets.

@johndiego
johndiego / dump.sql
Created March 28, 2017 03:23 — forked from manfe/dump.sql
Postgres - Estados e Cidades Brasileiras, dados extraídos do site do IBGE - SQL
-- Os dados contidos nesse arquivo foram extraídos do site: http://ibge.gov.br/cidadesat utilizando ruby, nokogiri e expressões regulares.
-- Autor: Mauricio Natanael Ferreira
-- Github: https://github.com/manfe
-- Twitter: @manfe01
-- Email: contato [at] ferreiramauricio [dot] com
-- ***********************************************************************************************************************************************
-- id ...
@johndiego
johndiego / dump.sql
Created March 28, 2017 03:23 — forked from manfe/dump.sql
Postgres - Estados e Cidades Brasileiras, dados extraídos do site do IBGE - SQL
-- Os dados contidos nesse arquivo foram extraídos do site: http://ibge.gov.br/cidadesat utilizando ruby, nokogiri e expressões regulares.
-- Autor: Mauricio Natanael Ferreira
-- Github: https://github.com/manfe
-- Twitter: @manfe01
-- Email: contato [at] ferreiramauricio [dot] com
-- ***********************************************************************************************************************************************
-- id ...
@johndiego
johndiego / dump.sql
Created March 28, 2017 03:23 — forked from manfe/dump.sql
Postgres - Estados e Cidades Brasileiras, dados extraídos do site do IBGE - SQL
-- Os dados contidos nesse arquivo foram extraídos do site: http://ibge.gov.br/cidadesat utilizando ruby, nokogiri e expressões regulares.
-- Autor: Mauricio Natanael Ferreira
-- Github: https://github.com/manfe
-- Twitter: @manfe01
-- Email: contato [at] ferreiramauricio [dot] com
-- ***********************************************************************************************************************************************
-- id ...
@johndiego
johndiego / estados-cidades.json
Created June 20, 2017 23:24 — forked from letanure/estados-cidades.json
JSON estados cidades
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
class OSServico(BaseModelNavegacao,TimeStampedModelBase):
cidade = models.ForeignKey(Cidade,verbose_name = 'CIDADES',max_length=20 , unique=False)
produto = models.ForeignKey(Pessoa,verbose_name = 'PRODUTO',max_length=20)
os_clientes = models.ForeignKey(Corporativo,verbose_name = 'CLIENTE',max_length=20)
OSServico.objects.values('os_clientes__nome','status_os','data_hora_acio','pk' ,'produto__nome_razao_social','area_servico__nome')\
.filter(status_os__in = FINANCEIRO_FILTROS).annotate(corp=Sum('os_clientes'))
@johndiego
johndiego / install.sh
Created December 21, 2017 23:49 — forked from wdullaer/install.sh
Install Latest Docker and Docker-compose on Ubuntu
# Ask for the user password
# Script only works if sudo caches the password for a few minutes
sudo true
# Install kernel extra's to enable docker aufs support
# sudo apt-get -y install linux-image-extra-$(uname -r)
# Add Docker PPA and install latest version
# sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 36A1D7869245C8950F966E92D8576A8BA88D21E9
# sudo sh -c "echo deb https://get.docker.io/ubuntu docker main > /etc/apt/sources.list.d/docker.list"
@johndiego
johndiego / asterisk.py
Created January 4, 2018 18:28 — forked from jfinstrom/asterisk.py
Example of using the Asterisk Manager API in python...
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# asterisk.py
#
# Copyright 2014 James Finstrom<jfinstrom at gmail>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
@johndiego
johndiego / apache.conf
Created January 12, 2018 12:29 — forked from maliMirkec/apache.conf
Install Varnish on Vesta CP
<IfModule mpm_prefork_module>
StartServers 1
MinSpareServers 1
MaxSpareServers 3
MaxClients 6
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 1
@johndiego
johndiego / complete-example.php
Created January 12, 2018 12:42 — forked from cballou/complete-example.php
Adding Role Based User Access Controls to your WordPress Plugin
<?php
class jinx {
// stores the path to our plugin
protected $pluginurl;
// stores the ACL roles
protected $defaultOptionVals;
/**