Syntax highlighting
Skeletonz got a new kick ass feature today and it's syntax highlighting (for around 46 languages)!
The code is from a new project called PyKleur - from the guys behind Pocoo. And now, check this out: JavaScriptfunction RND(tmpl, ns, scope) {
scope = scope || window;
var fn = function(w, g) {
g = g.split("|");
var cnt = ns[g[0]];
for(var i=1; i < g.length; i++)
cnt = scope[g[i]](cnt);
if(cnt == 0 || cnt == -1)
cnt += '';
return cnt || w;
};
return tmpl.replace(/%\(([A-Za-z0-9_|.])\)/g, fn);
}
Pythondef hasSpam(text):
fp = open("%s/spam_words.txt" % os.path.dirname(__file__), "r")
list = fp.readlines()
list = map(lambda x: x.strip(), list)
for w in list:
if text.find(w) != -1:
return True
return False
C#include <stdio.h>
main() {
printf ("Hello World!\n");
}
LaTeX\documentclass[a4paper,10pt]{article}
\usepackage{german}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{hyphenat}
\usepackage{url}
\usepackage{ifpdf}
\ifpdf \usepackage[pdftex,bookmarks]{hyperref} \fi
\bibliographystyle{gerplainurl}
\sloppy
\title{A small sample \dots}
\author{My, myself, and I}
\date{\today}
\begin{document}
\maketitle
\tableofcontents
...
\end{document}
4 comments so far
Post a comment
Commenting on this post has expired.
|
Blog labels |