Skip to content

Instantly share code, notes, and snippets.

View rg3915's full-sized avatar
🏠
Working from home

Regis Santos rg3915

🏠
Working from home
View GitHub Profile
@rg3915
rg3915 / setup.sh
Last active March 9, 2016 18:12 — forked from Benedikt1992/setup.sh
Setup apache-2.4.16 + php-5.6.11 on CentOS 6.7
#!/usr/bin/env bash
# Install dependencies
yum update -y
yum install -y gcc apr-devel apr-util-devel openssl-devel pcre-devel libxml2-devel libcurl-devel
mkdir setup && cd setup
wget wget https://olex-secure.openlogic.com/content/private/5e6a6f0815e830bba705e79e4a0470fbee8a5880//olex-secure.openlogic.com/httpd-2.4.16.tar.gz
tar -xvf httpd-2.4.16.tar.gz
@rg3915
rg3915 / tree.py
Last active March 17, 2018 02:06 — forked from lffsantos/tree.py
tree.py
from collections import defaultdict
import copy
import csv
import json
from urllib.parse import urlparse
def parser_urls(urls, orig={}):
'''
recebe uma lista de urls e vai parseando enquanto essa tiver um diretorio
@rg3915
rg3915 / forms.py
Created February 29, 2016 05:33 — forked from neara/forms.py
Django Class Based Views and Inline Formset Example
from django.forms import ModelForm
from django.forms.models import inlineformset_factory
from models import Sponsor, Sponsorship
class SponsorForm(ModelForm):
class Meta:
model = Sponsor
@rg3915
rg3915 / bootstrap.sh
Created January 16, 2016 14:34 — forked from cuducos/bootstrap.sh
Computer Bootstraps
#!/bin/bash
##############################################################################
# Install system packages #
##############################################################################
# if apt-get exists, probably it's a Linux
if which apt-get > /dev/null; then
# update & clean up
@rg3915
rg3915 / colorbrewer.js
Last active March 17, 2018 02:09 — forked from MaxMorais/colorbrewer.js
D3 colorbrewer.js
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
},YlGnBu: {
@rg3915
rg3915 / anp_crawler.py
Created December 1, 2015 01:45 — forked from luzfcb/anp_crawler.py
Implementação simples de um Crawler pra extrair dados do site a ANP
# coding=utf-8
"""
**Implementa um Webcrawler para extracao de dados da pesquisa de media de precos realizada periodicamente pela ANP**
Desenvolvido por Fabio C. Barrionuevo da Luz. - 2013
Simple crawler to ANP site
Copyright (C) 2013 Fabio C. Barrionuevo da Luz.
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