Skip to content

Instantly share code, notes, and snippets.

View nsheff's full-sized avatar

Nathan Sheffield nsheff

View GitHub Profile
@nsheff
nsheff / gnote_to_md
Created February 27, 2023 13:46
Converts tomboy or gnote xml format into markdown
mkdir -p md
for f in `ls *.note`; do
TITLE=`xml_grep 'title' "$f" --text_only`
echo "$f: $TITLE"
NOTE_CONTENT=`xml_grep 'note-content' "$f" --text_only`
CREATE_DATE=`xml_grep 'create-date' "$f" --text_only`
MOD_DATE=`xml_grep 'last-change-date' "$f" --text_only`
echo "---
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[0;33m'
NC='\033[0m' # No Color
function fail {
printf "${RED}\u2716 $@${NC}\n"
}
@nsheff
nsheff / pandoc_readme.py
Created August 29, 2019 16:53
use pandoc for python readme
# Handle the pypi README (long description) formatting.
try:
import pypandoc
long_description = pypandoc.convert_file('README.md', 'rst')
msg = "\033[032mPandoc conversion succeeded.\033[0m"
except(IOError, ImportError, OSError):
msg = "\033[0;31mWarning: pandoc conversion failed!\033[0m"
long_description = open('README.md').read()
@nsheff
nsheff / refget.py
Last active August 7, 2019 13:10
refget gist
import base64
import hashlib
import binascii
# Refget digests from published refget v1.0 protocol
# Retrieved July 2019
# http://samtools.github.io/hts-specs/refget.html
def trunc512_digest(seq, offset=24):
digest = hashlib.sha512(seq.encode()).digest()
Markdown:
# Code blocks
```
This is a fenced code block
```
This is an indented code block
@nsheff
nsheff / compbioconf.md
Last active July 9, 2021 21:32
computational_biology_conferences

A table of conferences that may be of interest to group members. Please add new conferences in chronological order.

2022

Date Location Conference
July 1-14 Madison Wisconsin ISMB

2021

Date Location Conference
@nsheff
nsheff / writing_good_commit_messages.md
Created May 27, 2016 16:01
Writing good commit messages

(shamelessly stolen from the erlang project)

Good commit messages serve at least three important purposes:

  • To speed up the reviewing process.

  • To help us write a good release note.

  • To help the future maintainers of Erlang/OTP (it could be you!), say five years into the future, to find out why a particular change was made to the code or why a specific feature was added.

``` {r}
library("LOLA")
dbPath = system.file("extdata", "hg19", package="LOLA")
regionDB = loadRegionDB(dbPath)
locResults = runLOLA(userSet, userUniverse, regionDB, cores=1)
locResults[order(support, decreasing=TRUE),]
writeCombinedEnrichment(locResults, outFolder= "lolaResults");
```
here's some R code:
```{r}
letters
```