Skip to content

Instantly share code, notes, and snippets.

View csw's full-sized avatar

Clayton Wheeler csw

  • Genomenon
  • Nashville, Tennessee
View GitHub Profile
@csw
csw / MyriadPro.cmap
Created November 7, 2019 17:06
ToUnicode CMap for Myriad Pro
%!PS-Adobe-3.0 Resource-CMap
%%DocumentNeededResources: ProcSet (CIDInit)
%%IncludeResource: ProcSet (CIDInit)
%%BeginResource: CMap (MyriadPro-Regular-UCMap)
%%Title: (MyriadPro-Regular-UCMap callas MyriadPro-Regular-UCMap 0)
%%EndComments
/CIDInit /ProcSet findresource begin
12 dict begin
@csw
csw / rdqdump2
Last active August 30, 2017 18:48
RabbitMQ recovery scripts
#!/usr/bin/env python3
import struct
import sys
# Directly inspired by Jeff Bryner's rdqdump:
# https://github.com/jeffbryner/rdqdump
#
# This does essentially the same thing, but works with the binary data directly.
@csw
csw / switch.el
Created October 14, 2013 22:02
init.el fragment for switching between source and headers
;; for init.el
(defun csw/c-mode-common-setup ()
(local-set-key (kbd "C-c C-o") 'ff-find-other-file))
(add-hook 'c-mode-common-hook 'csw/c-mode-common-setup)
@csw
csw / cron_runner
Last active December 23, 2015 11:59
Simple, general pid lock file mechanism for ksh, for cron jobs (esp. on Solaris)
#!/bin/ksh
function grab_lock {
pid_lock $lockfile || exit 1
if [ ! -e $lockfile ]; then
print -u 2 "Lock file $lockfile should exist!"
exit 1
fi
}
@csw
csw / .gdbinit
Last active December 16, 2015 03:18
.gdbinit for using g++ 4.7.1 with gdb 7.5.1 on Mac OS X 10.8
set print pretty on
set print object on
set print static-members on
set print vtbl on
set print demangle on
set demangle-style gnu-v3
set print sevenbit-strings off
python
import sys
@csw
csw / maf_tile.xml
Created August 21, 2012 19:33
Galaxy tool descriptor for maf_tile
<tool id="bio_maf_tile" name="Tile MAF blocks with reference sequence"
version="1.0.1">
<description>Concatenates multiple alignments for a set of
intervals, filling gaps from a reference sequence</description>
<command interpreter="bash">
bioruby_runner maf_tile --bed $input1
#if $bed_species:
--bed-species $bed_species
#end if
#if $one_based then "--one-based" else ""#
@csw
csw / sambamba_iotime.d
Created August 2, 2012 06:11
DTrace script to measure total I/O time
#!/usr/sbin/dtrace -s
syscall::read:entry
/execname == "sambamba"/
{
self->ts = timestamp;
self->fd = arg0;
}
syscall::read:return
#!/usr/bin/env ruby
require 'benchmark'
n = 10000000
line = 's tupBel1.scaffold_3803.1-85889 33686 61 + 85889 ttcaggaagggggcccaaaacgcttgagtggtcagctctta-ttttgcgtttactggatggg'
Benchmark.bmbm do |x|
x.report("basic String#split") do
n.times do