This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SVN Gource | |
# Download http://gource.googlecode.com/files/svn-gource-1.2.tar.gz and place svn-source.py in directory | |
# 1 Day = 0.05 seconds | |
COMPRESSION=0.05 | |
svn log --verbose --xml > my-project.log | |
python svn-gource.py --filter-dirs my-project.log > data_unsorted.log | |
sort -t'|' -k1 data_unsorted.log > data_sorted.log | |
gource --log-format custom data_sorted.log -s $(COMPRESSION) --disable-progress --stop-at-end --output-ppm-stream - | ffmpeg -y -b 3000K -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -vpre libx264-default gource.mp4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Stephen Diehl ( [email protected] ) | |
# Build up an OWL ontology recursively from the Python given Python objects inheritance tree. | |
from xml.dom import minidom | |
def generate(icls): | |
xml = minidom.Document() | |
rdf = xml.createElement('rdf:RDF') | |
rdf.setAttribute('xmlns:owl','http://www.w3.org/2002/07/owl#') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def generate(icls): | |
strs = [] | |
def descend(cl): | |
for cls in cl.__subclasses__(): | |
strs.append('[%s]^[%s|%s]' % (cl.__name__,cls.__name__, ';'.join(cls.__dict__.keys()))) | |
descend(cls) | |
descend(icls) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
eqtexsvg.py | |
Modified from the script by Julien Vitard <[email protected]> | |
This program is free software; you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 2 of the License, or | |
(at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
infixl (and) ∧; | |
infixl (or) ∨; | |
infixl (or) xor; | |
infixl (and) nand; | |
infixl (or) xnor; | |
infixl (or) iff; | |
infixl (or) implies; | |
infixl (or) ⊕; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.template.defaultfilters import stringfilter | |
register = template.Library() | |
# Usage: | |
# template.render({'showme': False }) | |
# {% conditional_display showme %} -> style="display: none" | |
@register.tag(name="conditional_display") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>insert mathml</title> | |
<script type="text/javascript"> | |
function addSqrt(){ | |
var mml_namespace = "http://www.w3.org/1998/Math/MathML"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EDITOR=vim | |
set -o vi | |
zstyle :compinstall filename '/home/stephen/.zshrc' | |
autoload -Uz compinit | |
compinit | |
setopt AUTO_CD # cd if no matching command | |
setopt AUTO_PARAM_SLASH # adds slash at end of tabbed dirs | |
setopt CHECK_JOBS # check bg jobs on exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convertMath = function (node) { | |
try { | |
if (node.nodeType == 1) { | |
var newnode = document.createElementNS("http://www.w3.org/1998/Math/MathML", node.nodeName.toLowerCase()); | |
for (var i = 0; i < node.attributes.length; i++) | |
newnode.setAttribute(node.attributes[i].nodeName, node.attributes[i].nodeValue); | |
for (var i = 0; i < node.childNodes.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fib = 1 : 1 : [ a+b | (a,b) = zip fib (tail fib) ] & ; |
OlderNewer