This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: UTF-8 -*- | |
""" | |
Esse programa tem o objetivo de criar uma aplicação que seja útil para jogadores de buraco. | |
As variáveis serão declaradas abaixo, de acordo com o tipo de dado que a mesma receberá | |
""" | |
# Variáveis to tipo STRING |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
This is a game idea [what about for Christmas night] using QR-code. | |
(1) First I've generated several codes (each one with a different value), | |
in my case I use money (values on Brazilian Real) and at the party | |
(2) We randomly assign one to each participant | |
(3) They need scan the code to get the prize |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
import re | |
import csv | |
import sys | |
from datetime import datetime | |
tweets = csv.reader(open("tweets.csv"), delimiter=',', quotechar='"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
import re | |
import csv | |
tweets = csv.reader(open("tweets.csv"), delimiter=',', quotechar='"') | |
exp = 'http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+' | |
for tweet in tweets: | |
urls = re.findall(exp, tweet[5]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
import re | |
import csv | |
import sys | |
from pytagcloud import create_tag_image, make_tags | |
from pytagcloud.lang.counter import get_tag_counts | |
limit = int(sys.argv[-1]) | |
tweets = csv.reader(open("tweets.csv"), delimiter=',', quotechar='"') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var b = new Boolean(false); | |
if (b) { | |
console.log("b was truthy"); | |
} | |
else { | |
console.log("b was falsey"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# wp2jekyll.py - convert a Wordpress dump (MySQL) to "pure" text for Jekyll plataform | |
# | |
# author: tiago maluta | |
# e-mail: [email protected] | |
import MySQLdb | |
# data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import serial | |
import re | |
import time | |
device="/dev/ttyACM0" # modem interface | |
class Modem: | |
def __init__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import random | |
random.seed(os.urandom(256)) | |
for i in range(6): | |
t = random.randrange(1,60) | |
print t | |
time.sleep(t) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install gpsd gps-clients and python | |
import gps | |
gpsd = gps.gps() | |
gpsd.stream(gps.WATCH_ENABLE|gps.WATCH_NEWSTYLE) | |
for report in gpsd: | |
if report['class'] == 'TPV': | |
print report['lat'] |