Skip to content

Instantly share code, notes, and snippets.

View gladson's full-sized avatar
😎
Vá lutar pelo que você acredita.

Gladson gladson

😎
Vá lutar pelo que você acredita.
View GitHub Profile
@gladson
gladson / fdsdfsdf
Created November 27, 2011 20:19
fdsgdfgdf
import random
import math
import timeit
import heapq
N = 100
# Insertion sort
@gladson
gladson / gist:1398091
Created November 27, 2011 20:25
teste
from django.db import models
from django.contrib import admin
from django.utils.translation import ugettext as _
from django.utils.encoding import force_unicode
from django.http import HttpResponse, HttpResponseRedirect
class DateTime(models.Model):
datetime = models.DateTimeField(auto_now_add=True)
@gladson
gladson / gist:1399330
Created November 28, 2011 06:15
fdsgdfgdf
import time
from calendar import month_name
def mkmonth_lst():
if not Post.objects.count(): return []
year, month = time.localtime()[:2]
first = Post.objects.order_by("created")[0]
fyear = first.created.year
fmonth = first.created.month
@gladson
gladson / gist:1404998
Created November 29, 2011 14:32
fdsgdfgdf123
from django.shortcuts import render_to_response
from django.template import RequestContext
import urllib
from xml.dom import minidom
def google_weather(request):
GOOGLE_WEATHER_URL = 'http://www.weather.com/xml'
GOOGLE_IMG_ROOT = 'http://10.2.2.106/media'
url = GOOGLE_WEATHER_URL
@gladson
gladson / gist:1406066
Created November 29, 2011 19:24
Mais ou menos isso!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<meta name="generator" content="PyScripter">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.dynamicdrive.com/dynamicindex2/sagscroller.css" />
@gladson
gladson / gist:1413141
Created December 1, 2011 03:06
clima gladson
from django.template import RequestContext
from django.shortcuts import render_to_response,
from xml.dom import minidom
import urllib2
def rondonia_cafe_capa(request):
GOOGLE_WEATHER_URL = 'http://www.google.com/ig/api?weather=porto+velho&hl=pt-BR&ie=UTF-16&ll=-8.760224,-63.901978&spn=3.794279,6.696167&sll=-9.020728,-63.726196&sspn=3.791585,6.696167&vpsrc=0&hnear=Porto+Velho+-+Rond%C3%B4nia&t=h&z=8'
url = GOOGLE_WEATHER_URL
@gladson
gladson / gist:1413163
Created December 1, 2011 03:09
clima gladson
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<xml_api_reply version="1">
<weather module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0">
<forecast_information>
<city data="Porto Velho, RO"/>
<postal_code data="porto velho"/>
<latitude_e6 data=""/>
<longitude_e6 data=""/>
<forecast_date data="2011-11-30"/>
<current_date_time data="1970-01-01 00:00:00 +0000"/>
@gladson
gladson / gist:1432591
Created December 5, 2011 06:45
MultyUpload.py
"""
A newforms widget and field to allow multiple file uploads.
Created by Edward Dale (www.scompt.com)
Released into the Public Domain
"""
from django.utils.encoding import force_unicode
from django.utils.datastructures import MultiValueDict
from django.utils.translation import ugettext
@gladson
gladson / gist:1470994
Created December 13, 2011 07:00
32434234werwfsdf?
<!DOCTYPE html>
<html>
<head>
<title> jQuery Youtube </title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="../../reset.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="../../screen.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="screen.css" type="text/css" media="screen" charset="utf-8">
@gladson
gladson / gist:1472900
Created December 13, 2011 16:52
paging
<!DOCTYPE html>
<html>
<head>
<title> jQuery Youtube </title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<link rel="stylesheet" href="../../reset.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="../../screen.css" type="text/css" media="screen" charset="utf-8">
<link rel="stylesheet" href="screen.css" type="text/css" media="screen" charset="utf-8">