Skip to content

Instantly share code, notes, and snippets.

View maluta's full-sized avatar

Tiago Maluta maluta

View GitHub Profile
# -*- 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
#!/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
#!/usr/bin/python
# -*- coding:utf-8 -*-
import re
import csv
import sys
from datetime import datetime
tweets = csv.reader(open("tweets.csv"), delimiter=',', quotechar='"')
#!/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])
#!/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='"')
@maluta
maluta / test.js
Created December 9, 2013 17:06
to run, install nodejs and then $ node test.js
var b = new Boolean(false);
if (b) {
console.log("b was truthy");
}
else {
console.log("b was falsey");
}
#!/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
#!/usr/bin/python
import serial
import re
import time
device="/dev/ttyACM0" # modem interface
class Modem:
def __init__(self):
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)
# 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']