Davide Muzzarelli

Dynamic pure SQL WHERE clauses and optional JOINs

How to create queries with powerful dynamic filters using only pure SQL.

How to use Go and FastCGI

pubblicato it 03.09.2013 in # in english, * livello avanzato, golang, script completi

FastCGI is a good solution for using Go in a shared hosting like Dreamhost http://wiki.dreamhost.com/FastCGI or also in a VPS. This post is about how to write a Go program in FCGI mode and deploy it on Apache.

Two template filters for Django

I want to signal two new template filters for Django. Precise truncate words by chars It truncates the text when it exceeds a certain number of characters and deletes the last word. Adds ‘…’ at the end of the text, only if truncated. The difference between other similar filters is that this deletes the last [...]

Convertire un repository SVN ad uno GIT in remoto

Recentemente ho convertito i miei repository Subversion verso GIT. La conversione in parte è dolorosa perché GIT è più difficile e complicato da usare rispetto a SVN ma offre un paio di vantaggi di cui ho bisogno: ottimizzazione della banda (possibilità di lavorare offline), migliore gestione dei branch. Prima o poi scriverò un post a [...]

Apache mod_rewrite and directories protected by password

As a web site developer, when I use a server side script (like a FCGI, PHP, ASP ecc.) I activate the mod_rewrite in order to convert the urls in a pretty format. So, an url like this: http://www.foobar.it/index.php?page=articles …could be converted like this: http://www.foobar.it/articles/ This is very good for SEO and just for the simplicity [...]

Python client for the Nirvanix API

pubblicato it 29.07.2008 in # in english, * livello avanzato, python

I released a Python client for Nirvanix. The project page is: https://www.hosted-projects.com/trac/Design/pub/wiki/Nirvanapi It include the most important API calls, is light (one file and less of 400 lines of code) and have not dependences. The client support right now the following API calls: LoginLogoutCreateFoldersDeleteFoldersDeleteFilesCopyFilesCopyFoldersMoveFilesMoveFoldersRenameFileRenameFolderSideuploadListFolderCreateHostedItemExtractFrames The login is automatic also when the connection drop. List a [...]

Preview di un testo con una sola riga di Python

pubblicato it 09.06.2007 in * livello avanzato, python, script completi

Nei siti web capita spesso di mostrare una preview di una news o di un articolo. Queste preview includono solo una parte del testo per poter elencare più articoli o news nella stessa pagina senza appesantire troppo la navigazione. A tal proposito ecco una funzione di una sola riga che prende un testo, lo accorcia [...]