Skip to content

Instantly share code, notes, and snippets.

View jamescasbon's full-sized avatar

James Casbon jamescasbon

View GitHub Profile
@jamescasbon
jamescasbon / bootstrap.coffee
Created April 15, 2012 12:33
Bootstrap example ported to coffeekup
doctype 5
html ->
head ->
title 'Title'
meta name: 'viewport', content: "width:device-width, initial-scale:1.0"
meta name: 'description', content: ""
meta name: 'author', content: ""
link href: 'bootstrap/css/bootstrap.css', rel: 'stylesheet'
link href: 'bootstrap/css/bootstrap-responsive.css', rel: 'stylesheet'
/*
Hello, this is Dog
------------------
Lets talk about cells.*/
// code cell
print(84);
@jamescasbon
jamescasbon / file1.txt
Created April 3, 2012 16:16
the description for this gist
String file contents
@jamescasbon
jamescasbon / bottle_redis.py
Created February 20, 2012 19:02
redis-db bottle
import redis
import inspect
class RedisPlugin(object):
name = 'redis'
def __init__(self,host='localhost',port=6379,database=0,keyword='rdb'):
self.host = host
self.port = port
self.database = database
@jamescasbon
jamescasbon / gist:1835699
Created February 15, 2012 13:35
Example sysadmin feature
Feature: Mail
In order to handle mail
Scenario: Mail relay
Given I am a production server
And I am not a mail server
Then I should have postfix installed
And I should have a mail relay to mail.example.org
Scenario: Mail server
@jamescasbon
jamescasbon / gist:1835715
Created February 15, 2012 13:40
steps file to go with the feature
from lettuce import *
from fabric import api
from fabric.api import env
import socket
servers = {
'xxx.local': {
'ip': ' xxxx',
'roles': ['production']
@jamescasbon
jamescasbon / gist:1585116
Created January 9, 2012 21:44
Python template example
d = Doc()
with d.html:
with d.head:
d.title ('example page')
d.link (rel='stylesheet', href='/style.css', type='text/css')
with d.body (style='foo'):
d.a ('other stuff on another page', href='/other.html')
@jamescasbon
jamescasbon / melt_vcf.py
Created October 19, 2011 08:49
Melt VCF files into a reasonable tab delimited format, one genotype per line
#!/usr/bin/env python
""" Melt a VCF file into a tab delimited set of calls, one per line
VCF files have all the calls from different samples on one line. This
script reads vcf on stdin and writes all calls to stdout in tab delimited
format with one call in one sample per line. This makes it easy to find
a given sample's genotype with, say, grep.
"""
import sys
@jamescasbon
jamescasbon / gist:1232114
Created September 21, 2011 14:06
freebayes build
$ make
cd ../bamtools && mkdir -p build && cd build && cmake .. && make
-- Configuring done
-- Generating done
-- Build files have been written to: /home/james/src/freebayes/bamtools/build
make[1]: Entering directory `/home/james/src/freebayes/bamtools/build'
make[2]: Entering directory `/home/james/src/freebayes/bamtools/build'
make[3]: Entering directory `/home/james/src/freebayes/bamtools/build'
make[3]: Leaving directory `/home/james/src/freebayes/bamtools/build'
make[3]: Entering directory `/home/james/src/freebayes/bamtools/build'