Skip to content

Instantly share code, notes, and snippets.

View gilsondev's full-sized avatar
💼
Work

Gilson Filho gilsondev

💼
Work
View GitHub Profile
@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active May 19, 2025 20:39
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@rishimukherjee
rishimukherjee / facepass.py
Created March 27, 2012 21:13
Example of use of SimpleCV. This creates a face recognized password.
#!/usr/bin/python
import time
from SimpleCV import Color, Image, np, Camera
cam = Camera() #initialize the camera
quality = 400
minMatch = 0.3
try:
password = Image("password.jpg")
@jacobian
jacobian / authuser.md
Created March 30, 2012 00:35
Upgrading auth.User - the profile approach

Upgrading auth.User - the profile approach

This proposal presents a "middle ground" approach to improving and refactoring auth.User, based around a new concept of "profiles". These profiles provide the main customization hook for the user model, but the user model itself stays concrete and cannot be replaced.

I call it a middle ground because it doesn't go as far as refactoring the whole auth app -- a laudable goal, but one that I believe will ultimately take far too long -- but goes a bit further than just fixing the most egregious errors (username length, for example).

This proposal includes a fair number of design decisions -- you're reading the fifth or sixth draft. To keep things clear, the options have been pruned out and on the one I think is the "winner" is still there. But see the FAQ at the end for some discussion and justification of various choices.

The User model

@hjr3
hjr3 / e-commerce.md
Created April 3, 2012 05:35
Examples of RESTful API calls for E-commerce platforms

Examples of RESTful API calls for E-commerce platforms

These examples are type 3 RESTful API requests and responses. The JSON-HAL specification is used to implement HATEOAS.

Some of the examples are based on my work as architect of the RESTful API at http://www.hautelook.com. All proprietary information has been removed.

Relevant links

@jordansissel
jordansissel / Procfile
Created April 5, 2012 19:29
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1
@jcook793
jcook793 / bash_prompt.sh
Created April 15, 2012 17:57 — forked from insin/bash_prompt.sh
Set color bash prompt according to active virtualenv, mercurial branch and return status of last command.
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch/status of the current mercurial repository
# * the return value of the previous command
#
# USAGE:
@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@gmgall
gmgall / site_tester.py
Created April 24, 2012 18:25
Testador de sites em Python com requests
#!/usr/bin/env python
# coding: utf-8
import fileinput
import requests
from clint.textui import puts, columns, colored
for line in fileinput.input():
line = line.strip()
response = requests.head(line, allow_redirects=True)
@douglasmiranda
douglasmiranda / gist:2552192
Created April 29, 2012 17:44
Gloobus Preview for Ubuntu 12.04
#INSTALL
sudo add-apt-repository ppa:gloobus-dev/gloobus-preview
sudo apt-get update
sudo apt-get install gloobus-preview gloobus-sushi
#For the oppenoffice documents to work, you should install unoconv too
sudo apt-get install unoconv
@douglasmiranda
douglasmiranda / gist:2565256
Created May 1, 2012 05:11
WebFaction: Total (MB) of memory usage app
ps -u username -o rss,command | grep -v peruser | awk '{sum+=$1} END {print sum/1024}'