Skip to content

Instantly share code, notes, and snippets.

Alessandro Balzano alfateam123

Block or report user

Report or block alfateam123

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alfateam123 /
Created Jul 2, 2014
Tumblr Tags retriever
import requests
from HTMLParser import HTMLParser
from collections import Counter
class TumblrParser(HTMLParser):
def __init__(self):
self.taglist = list()
alfateam123 / gist:f4cc5454896f91aa5c53
Last active Aug 29, 2015
waifu material for md2bbc
View gist:f4cc5454896f91aa5c53
Asagi - Anshinin (Medaka Box) - Akane Tsunemori
Banba, Mahiru - Barkhorn, Gerthrud
Charlotte - Chitoge - Chino - Chihiro (kaminomi)
Dora, Stephanie
Eru, Chitanda - Eli Ayase - Erio Touwa
View gist:caf649f537042ea5a33c
def add_letters(*combo_tree tree IN, letter_counter dict IN)
for letter in letter_counter.keys() do
if letter_counter[letter] > 0 then
letter_counter[letter] -= 1 //so che, nella ricorsione, ho una istanza in meno della stessa lettera a disposizione
alfateam123 /
Created Dec 9, 2014
/r9k/ to irc. markov bots, maybe? Use a very large n.
#!/usr/bin/env python
import moesearch as foolz
import argparse
parser = argparse.ArgumentParser("r9k to irc!")
parser.add_argument("pages", type=int, help="how many pages you want to download")
def retrieve_pages(pages=1):
for page in range(pages):
from __future__ import print_function
import re
import argparse
parser = argparse.ArgumentParser()
def generate_grammar(n):
dat_grammar = "(ab)?"
for i in range(1, n):
alfateam123 /
Created Mar 18, 2015
a little scripts for extracting only some fields from a csv.
import csv
import sys
import argparse
parser = argparse.ArgumentParser()
alfateam123 / Just an homemade os.rename
Created Feb 23, 2012
(My first gist! Yeah!) my way to rename files in a repository, using regex and "os" module
View Just an homemade os.rename
import os
import re
for root, dirs, files in os.walk(path):
print root, dirs, files
for filename in files:
if re.match("ex\d+match\d+\.txt", filename):
newname=re.sub(r"ex(?P<numero>\d+)match\d+.txt", r"ex\g<numero>.txt", filename)
print os.path.join(root, filename)
src=open(os.path.join(root, filename))
dst=open(os.path.join(root, newname), "w")
alfateam123 / [Turing Machine] count of As
Created May 9, 2012
Turing Machine that can count how many A are on a tape made up of As and Bs.
View [Turing Machine] count of As
(0, ab, initCounter, ab, <)
(initCounter, -, searchA, 0, >)
(searchA, a, goCounter, x, <)
(searchA, bx, searchA, xx, >)
(goCounter, x, goCounter, x, <)
(goCounter, 0..9, inc, 0..9, -)
(inc, [0..8-], goX, [1..91], >)
(inc, 9, inc, 0, <)
(goX, 0..9, goX, 0..9, >)
(goX, x, searchA, x, -)
alfateam123 / Simple Intendation error checker
Created Aug 31, 2012
This is a simple Indentation error checker. It uses "tabnanny" built-in module to check all Python files in a directory.
View Simple Intendation error checker
import tabnanny
from pprint import pprint
if __name__=="__main__":
You can’t perform that action at this time.