View http.sh
# Manage a simple HTTP server | |
# | |
# Usage: | |
# http start|stop|restart [port] | |
# | |
# Notes: | |
# Add to .bashrc and resource (source ~/.bashrc) | |
http () { | |
local port="${2:-8000}" |
View rst2html.sh
# Convert restructuredText file to HTML | |
# | |
# Usage: | |
# rst2html file.rst | |
# | |
# Notes: | |
# Add to .bashrc | |
# Set stylesheet path and/or default stylesheet | |
# Source .bashrc |
View svn.sh
# Three little shell functions of use when managing | |
# subversion repos. | |
# | |
# nosvn - remove a directory from revision control | |
# svnrev - print repo rev number | |
# startsvn - start the subversion daemon | |
# Remove directory from revision control | |
nosvn () { | |
DIR=${1:-"."} |
View xls2tsv.py
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
''' | |
xls2tsv - print the sheetnames or contents of a worksheet from an excel workbook. | |
Usage: xls2tsv [options] | |
Options: | |
-h, --help show this help message and exit |
View md2html.py
#!/usr/bin/env python | |
''' | |
md2html - convert a markdown file to html | |
Dependencies: markdown module (pip install Markdown) | |
Usage: | |
md2html file.md > file.html | |
md2html file.md | browser |
View index.html
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="style.css"> | |
<body> | |
<h1>READ.ME</h1> | |
<p>Why can't we just fence our code?</p> | |
<pre><code>print = console.log</code></pre> | |
<p>Another chunk of code:</p> | |
<pre><code>print 'hello world!'</code></pre> |
View coffee.vim
" Supplements for ~/.vim/ftplugin/coffee.vim. | |
" Use Mick Koch's [plugin](http://github.com/kchmck/vim-coffee-script) as base. | |
setlocal tabstop=2 | |
setlocal softtabstop=2 | |
setlocal shiftwidth=2 | |
ab bang! #!/usr/bin/env coffee | |
" ,r run/execute code in file (faster to type than ,x) |
View python.vim
" Language: Python | |
setlocal tabstop=4 | |
setlocal softtabstop=4 | |
setlocal shiftwidth=4 | |
ab bang! #!/usr/bin/env python | |
" run tests in current file | |
nmap <LocalLeader>t :!nosetests %<CR> |
View d3-coffee-skeleton.html
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
<script src="http://github.com/jashkenas/coffee-script/raw/master/extras/coffee-script.js"></script> | |
<style>/* CSS */</style> | |
<body> | |
<div id="viz"></div> | |
<script type="text/coffeescript"> | |
alert("hello world") | |
# CODE # |
View ftdetect-md-litcoffee.vim
" Add this to ~/.vim/ftdetect/md-litcoffee.vim | |
" Language: Literate CoffeeScript | |
autocmd BufNewFile,BufRead *.litcoffee set filetype=litcoffee | |
autocmd BufNewFile,BufRead *.coffee.md set filetype=litcoffee |
OlderNewer