Skip to content

Instantly share code, notes, and snippets.

View hernandesbsousa's full-sized avatar

Hernandes Benevides de Sousa hernandesbsousa

View GitHub Profile
@thiagophx
thiagophx / pp
Created March 17, 2015 18:42
JSON Pretty Print Stream
#!/usr/bin/python -u
import sys, json
from pygments import highlight
from pygments.lexers import JsonLexer
from pygments.formatters import Terminal256Formatter
while True:
line = sys.stdin.readline()
if line.strip():
@phrawzty
phrawzty / 2serv.py
Last active July 7, 2025 11:59
simple python http server to dump request headers
#!/usr/bin/env python2
import SimpleHTTPServer
import SocketServer
import logging
PORT = 8000
class GetHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@nelsonsar
nelsonsar / o_que_li_e_pretendo_ler.md
Last active September 29, 2019 10:39
O que li e pretendo ler

Acho que pra começar a falar alguma coisa sobre arquitetura e design é preciso ter uma boa noção sobre orientação a objetos e, infelizmente, não achei um lugar pra começar com facilidade. Pra corrigir esse problema eu pretendo muito em breve comprar o Object-Oriented Software Construction pra tentar extrair dele partes que tornem mais simples explicar e enteder OOP.

Com uma noção maior de OOP é hora de entender quais práticas são comuns dentro do paradigma. Recomendo fortemente o livro do Kent Beck Test Driven Development: By Example e o livro do Fowler o [Refactoring: Improving the Design of Existing Code](http://www.amazon.com/Refactoring-Improving-Design-Existing-Code/dp/0201485672/ref=sr_1_1?s=books&ie=UTF8&qid=1

@wdullaer
wdullaer / install.sh
Last active April 3, 2025 19:08
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"
@chibicode
chibicode / .vimrc
Created July 27, 2014 10:08
Goodbye Vim, Hello Sublime Text, and My Final .vimrc
" vim:fdm=marker
" Vundle {{{
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'airblade/vim-gitgutter'
Bundle 'bling/vim-airline'
Bundle 'chriskempson/base16-vim'
@jdennes
jdennes / Gemfile
Last active September 22, 2022 16:31
Export a list of members from a GitHub organisation
source "https://rubygems.org"
gem "octokit"
@rickmak
rickmak / slack_log.py
Created March 28, 2014 12:02
Python logger for slack
import logging
import json
import requests
class SlackHandler(logging.Handler): # Inherit from logging.Handler
def __init__(self, domain, token, channel, name='LOGGER'):
logging.Handler.__init__(self)
self.domain = domain
@raystorm
raystorm / monolog.yml
Created February 2, 2014 06:48
Symfony log to stdout & stderr
stdout:
type: stream
path: "php://stdout"
level: debug
stderr:
type: stream
path: "php://stderr"
level: warning
@bonobo78
bonobo78 / cmd
Last active December 27, 2015 23:29
Set default mapping for a single field
$ curl -XPUT http://127.0.0.1:9200/_template/logstash_per_index -d @file.json