Skip to content

Instantly share code, notes, and snippets.

View gilsondev's full-sized avatar
💼
Work

Gilson Filho gilsondev

💼
Work
View GitHub Profile
@douglasmiranda
douglasmiranda / 1ntro.markdown
Last active January 13, 2020 03:28
Django + git + apache mod_wsgi na Kinghost

#Django + git + apache mod_wsgi na Kinghost

NOTE: Atualmente não é necessário tanto para fazer deploy de aplicações Django na Kinghost.

I hope you like it!

##Início

Talvez você não queira ficar digitando a senha toda vez que usar o ssh, então adicione sua chave pública ao seu host:

# in /usr/share/xsessions
[Desktop Entry]
Name=Xmonad GNOME
Comment=Tiling window manager
TryExec=/usr/bin/gnome-session
Exec=gnome-session --session=xmonad
Type=XSession
@lucasdavila
lucasdavila / example_use_gravatar_image_tag.py
Last active July 7, 2021 01:06
Gravatar em 3 linhas com python
print gravatar_image_tag('[email protected]', 32, {'class' : 'avatar', 'alt' : 'your gravatar'})
<img src="http://www.gravatar.com/avatar/3b4d33514d78047bf86307ab354658df?size=32" alt="your gravatar" class="avatar" />
@herberthamaral
herberthamaral / requirements.txt
Created October 24, 2011 11:33
spider receita
"""
Simple script to get the citzen name by its CPF (Brazil's SSN)
"""
from BeautifulSoup import BeautifulSoup as bs
import requests
import urllib2
with requests.session() as session:
url = 'http://www.receita.fazenda.gov.br/aplicacoes/atcta/cpf/ConsultaPublica.asp'
response = session.get(url)
server {
listen 80;
server_name sistemas.pdg.com.br;
root /home/sistemas/virtualenvs/prd/portal;
location /media/ {
root /home/sistemas/virtualenvs/prd/portal;
expires max;
}
@flavianmissi
flavianmissi / testing_django_signals.py
Created November 6, 2011 01:56
Testing Django signals
from unittest import TestCase
from my_app.signals import foo_bar
class SignalsTestCase(TestCase):
def dummy_listener(self, sender, **kwargs):
self.times += 1
def test_deve_chamar_o_signal_foo_bar(self):
@herberthamaral
herberthamaral / gist:1350957
Created November 9, 2011 09:30
Exemplo de uso de args e kwargs no Python
# -*- coding: utf8 -*-
#exemplo de uso de args e kwargs
class Solido(object):
"""
Isso é um comentário multilinha no Python.
O método __init__ é o construtor da classe, ou seja
é o método que será executado quando a classe for instanciada.
Notem que eu tou usando o argumento 'volume' para esse método.
@hltbra
hltbra / gist:1372100
Created November 17, 2011 01:32
Links complementares à palestra "Quero ser programador! #comofas?"
Slides usados na SCTI 2011:
http://www.slideshare.net/hugobr/quero-serprogramadorcomofas
Eu separei alguns links que eu acho interessante pra quem estava na palestra.
Alguns estão nas referências dos slides, outros não:
* Teach Yourself Programming in Ten Years
>>> import random
>>> random.random()
0.37134260856263623
>>> random.choice(range(0,999))
360
@insin
insin / bash_prompt.sh
Created December 3, 2011 01:49 — forked from woods/git_svn_bash_prompt.sh
Set color bash prompt according to active virtualenv, git 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 git repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.