Skip to content

Instantly share code, notes, and snippets.

View mrs83's full-sized avatar

Massimo R. S. mrs83

  • Berlin, Germany
View GitHub Profile
#!/bin/bash
# geoip-update.sh -- update geoip lite database(s).
# author: massimo.scamarcia@gmail.com
#prg="wget --quiet"
prg="wget"
download_path="/usr/share/GeoIP/download"
geolite_path="/usr/share/GeoIP"
@mrs83
mrs83 / get_querystring_template_tag.py
Created August 26, 2013 21:56
A Django Template tag used to construct urls with current querystring parameters. This is based on some code that I've written some years ago. Enjoy.
from django import template
from django.http import QueryDict
from django.utils.safestring import mark_safe
from django.template.loader import get_template
register = template.Library()
class QueryStringNode(template.Node):
def __init__(self, to_add, to_remove):
self.to_add = to_add
@mrs83
mrs83 / tetris.py
Created November 11, 2016 19:09
Tetris!!!!
import curses
from random import choice
class TetrisGame:
"""Tetris Game - class-based version. """
pieces = [
[(0, 0), (0, -1), (0, 1), (1, 1)],
[(0, 0), (0, -1), (0, 1), (-1, 1)],
[(0, 0), (0, -1), (1, -1), (1, 0)],