Skip to content

Instantly share code, notes, and snippets.

View jmarshall's full-sized avatar

John Marshall jmarshall

View GitHub Profile
@jmarshall
jmarshall / actionversions
Last active October 24, 2023 23:30
Determine node runtime version used by common GitHub Actions
#!/usr/bin/perl
#
# Usage: grep uses: {DIR,DIR}/.github/workflows/*.y*l | actionversions
# or: git grep uses: | actionversions
# or: cat .github/workflows/*.y*l | actionversions
my %used;
while (<>) {
next unless /uses\s*:\s*['"]?([^'"\s]+)/;
$used{$1}++;
@jmarshall
jmarshall / bgzfsize.c
Last active February 10, 2024 18:36
Display BGZF compression statistics
/* bgzfsize.c -- Display uncompressed sizes of BGZF files
Copyright (C) 2009 John Marshall
*/
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <inttypes.h>
@jmarshall
jmarshall / codespell
Created September 17, 2020 11:11
Codespell wrapper script and filters for HTSlib et al
#!/bin/sh
skip=`(cat /dev/null $(find . -name 'wt-*' -prune -o -name .gitignore -print) | sed '/^$/d;s&^.*/&&'; printf '.DS_Store,*.dSYM
*.sam,*.bam,*.cram
*.fq,*.vcf
*.bed,*.bai,*.csi,*.crai,*.gz,*.gz.*
*.out,*.expected
aclocal.m4
.git,interesting,wt-*')|tr '\n' ,`
@jmarshall
jmarshall / fmt-includes
Created September 20, 2019 10:18
Hacky Perl script for updating HTSlib/samtools/bcftools Makefile dependencies
#!/usr/bin/perl
use strict;
use warnings;
my $curfname = "";
my $pkg = "";
my %var = (
# htslib
"cram/cram.h" => "cram_h",
@jmarshall
jmarshall / tweak-github.css
Last active October 28, 2022 08:40
User CSS for GitHub: square the circular avatars, hide dashboards' “Member statuses” sidebar
/* Hide GitHub dashboards' "Member statuses" sidebar, while hopefully not
doing too much damage to other web sites. For e.g. Safari, save this
somewhere and select it in Preferences :: Advanced :: Style sheet. */
@media screen and (min-width: 1012px) {
body.page-responsive > div.application-main > div.d-md-flex
div.mt-3.border-bottom
{ width: 100% !important }
body.page-responsive > div.application-main > div.d-md-flex
@jmarshall
jmarshall / Dockerfile
Created September 21, 2018 14:23
Basic Dockerfile for fully-featured HTSlib/SAMtools/BCFtools
ARG ubuntu_version=latest
FROM ubuntu:${ubuntu_version}
USER root
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
libbz2-dev \