Skip to content

Instantly share code, notes, and snippets.

@nkabir
nkabir / eltreedemo.py
Created October 16, 2011 13:25
Gist for Praxis Documentation
import elementtree.ElementTree as ET
# build a tree structure
root = ET.Element("html")
head = ET.SubElement(root, "head")
title = ET.SubElement(head, "title")
title.text = "Page Title"
@nkabir
nkabir / mathjax.html
Created October 16, 2011 19:29
MathJax setup
<script type="text/javascript"
src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
@nkabir
nkabir / gist:1291607
Created October 16, 2011 23:43
VirtualBox vboxdrv kernel warning
$ WARNING: The vboxdrv kernel module is not loaded. Either there is no module
available for the current kernel (2.6.32-34-server) or it failed to
load. Please recompile the kernel module and install it by
sudo /etc/init.d/vboxdrv setup
You will not be able to start VMs until this problem is fixed.
@nkabir
nkabir / .vimrc
Created October 18, 2011 16:32
.vimrc file
syntax on
filetype on
set encoding=utf8
" set paste // disabled set paste because it interferes with snippets
set expandtab
" enable softwrap
set wrap linebreak textwidth=0
set tabstop=4
set softtabstop=4
set shiftwidth=4
@nkabir
nkabir / sources.list
Created October 22, 2011 19:16
Ubuntu configuration files
# deb cdrom:[Ubuntu 10.04.3 LTS _Lucid Lynx_ - Release amd64 (20110720.1)]/ lucid main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
## Major bug fix updates produced after the final release of the
## distribution.
@nkabir
nkabir / gist:1308119
Created October 24, 2011 00:24
bbblitz package manifest
#############################################################################
# Portion Package Manager Manifest
##############################################################################
##############################################################################
# Autoconfiguration Variables
##############################################################################
# name of package
$package=bbblitz
@nkabir
nkabir / setup-pandas.sh
Created November 1, 2011 18:11
set up pandas on Ubuntu 10.04 LTS
#!/usr/bin/env bash
apt-get -y install build-essential python-dev python-setuptools python-pip python-tk
apt-get -y install gfortran libatlas-base-dev libfreetype6-dev libpng12-dev tk-dev tk8.5-dev
apt-get -y install python-dateutil
pip install numpy
pip install scipy
pip install pandas
pip install matplotlib
@nkabir
nkabir / Asset.py
Created November 3, 2011 16:29
Sample Python file
#!/usr/bin/env python
def do_something():
print "I'm doing something!"
if __name__ == "__main__":
print "hello, from Asset.py"
@nkabir
nkabir / ipython.sh
Created November 22, 2011 17:35
ipython launch script
#!/usr/bin/env bash
# Note that you can augment this path with additional folders separated with ":" (colons)
# for example export PYTHONPATH=$HOME/hgdev/org.bitbucket/nkabir/pywork:/usr/local/python
export PYTHONPATH=$HOME/hgdev/org.bitbucket/nkabir/pywork
ipython
@nkabir
nkabir / paypv.py
Created November 27, 2011 18:43
Python Runner Scripts
#!/usr/bin/env python
import sys
if __name__ == "__main__":
print sys.argv