Syntactic Whitespace

Syntax Highlighting in Django

Posted in code, snippets by Mike on the September 11th, 2007

I am currently working on a project with Django A Python web framework ,
It will be a pastebin application , all good pastebins have syntax highlighting … I just wanted to show you how I did it … it can be useful for other projects,

1 def syntax(value,extension):
2     from pygments.lexers import get_lexer_for_filename
3     from pygments import highlight
4     from pygments.formatters import HtmlFormatter
5     "Highlights the syntax of a file based on file extension"
6     lexer = get_lexer_for_filename("file." + extension, stripall=True)
7     formatter = HtmlFormatter(linenos=True)
8     result = highlight(value, lexer, formatter)
9     return result

Sorry for the lack of posts , I will have more snippets up soon

Netvibes Rocks

Posted in Uncategorized by Mike on the December 16th, 2006

Netvibes just keeps getting better and better …I have not posted about netvibes before…but it is my homepage of choice..You can add rss feeds , email , calendars and Countless other widgets and modules made by the Community …They have just added a new skin with a winter theme

Tags:

(more…)

…you think they would get it by now ?

Posted in Funny, Tech, email, funny spam, gmail, interesting, links, spam, web by Mike on the August 11th, 2006

You know ….you just gotta laugh at some of these spammers attempts I got one sent to me today

Dear Friend, I need a partner for $14 million deal, for more details please contact me immediately . Thanks Musa Kente

mmhmm …sure …because random people named musa

ALWAYSRandomly offer 14 million bucks to me…Either people are getting stupider or spammers are getting stupider …because this ispathetic :D