Skip to content

Instantly share code, notes, and snippets.

View mr-c's full-sized avatar

Michael R. Crusoe mr-c

View GitHub Profile
@hexylena
hexylena / cite.py
Last active May 6, 2024 11:12
Replace \cite{10.1234/some-key} with actual citation, doi2bib must be installed.
#!/usr/bin/env python
# license: cc0/public domain
import re
import sys
import subprocess
input_file = sys.argv[1]
output_file = input_file.replace('.tex', '.bib')
with open(input_file, "r") as f:
# IDA (disassembler) and Hex-Rays (decompiler) plugin for Apple AMX
#
# WIP research. (This was edited to add more info after someone posted it to
# Hacker News. Click "Revisions" to see full changes.)
#
# Copyright (c) 2020 dougallj
# Based on Python port of VMX intrinsics plugin:
# Copyright (c) 2019 w4kfu - Synacktiv
@noamross
noamross / find_local_tweeps.R
Created August 14, 2017 23:43
A visit to Durham
library(rtweet) #rtweet API creds should already be set up
library(stringi)
library(dplyr)
friends = get_friends(user="noamross")
followers = get_followers("noamross")
tweeps_id = distinct(bind_rows(friends, followers))
tweeps_info = lookup_users(tweeps_id$user_id)
# A regex for a visit to Durham
# Implement support for Common Workflow Language (CWL) for Toil.
#
# Copyright (C) 2015 Curoverse, Inc
# Copyright (C) 2016 UCSC Computational Genomics Lab
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
@dale3h
dale3h / gitter-backup.sh
Created May 17, 2017 13:13
Perform local backups of Gitter.im chat rooms.
#!/bin/bash
#
# Perform local backups of Gitter.im chat rooms.
GITTER_ARCHIVE_URL="https://gitter.im/%s/archives/%s"
usage() {
echo "usage: $(basename $0) -f -r <chat-room> [-o <output-dir>] [-s <YYYY/MM/DD>] [-e <YYYY/MM/DD>]" 1>&2
exit 1
}
@aphyr
aphyr / pdf-sign
Created June 10, 2016 15:40
Script to sign the final page of a PDF using inkscape and pdfseparate/pdfunite.
#!/bin/bash
DIR=`mktemp -dt pdf-sign.XXXXXXXX` || exit 1
cd "$DIR"
pdfseparate "$1" "$DIR/page%d.pdf"
inkscape `ls | tail -1`
pdfunite page*.pdf "$1 signed.pdf"
rm -rf "$DIR"
@jonasmalacofilho
jonasmalacofilho / safesign.md
Created July 1, 2014 22:12
Instalando o SafeSign Crypto USB Token no Firefox/Linux

Instalando o SafeSign Crypto USB Token no Firefox/Linux

Hardware: Giesecke & Devrient SafeSign Crypto USB Token

Sistema operacional: Ubuntu 14.04 LTS AMD 64

  1. Dependências: libccid, pcscd e libpcsclite1. Adicionalmente, é interessante instalar o pacote pcsc-tools e executar pcsc_scan para verificar a visibilidade do token.
@bede
bede / install-sci-py-osx
Last active December 25, 2015 02:48
Install scientific Python (inc. IPython) on virgin Mac OS X 10.8
## Prerequisites
# Latest Xcode
# Latest Apple command line utilities
# Homebrew (check 'brew doctor')
# 20+ minutes (new machine with SSD – hours on our lab's 2008 Mac Pro)
## Commands (instead install scipy superpack?)
brew install python # Symlinking may well be problematic – use 'brew link --overwrite python' if necessary)
pip install virtualenv
pip install virtualenvwrapper
@nathanhaigh
nathanhaigh / deinterleave_fastq.sh
Last active May 6, 2024 06:38
deinterleave FASTQ files
#!/bin/bash
# Usage: deinterleave_fastq.sh < interleaved.fastq f.fastq r.fastq [compress]
#
# Deinterleaves a FASTQ file of paired reads into two FASTQ
# files specified on the command line. Optionally GZip compresses the output
# FASTQ files using pigz if the 3rd command line argument is the word "compress"
#
# Can deinterleave 100 million paired reads (200 million total
# reads; a 43Gbyte file), in memory (/dev/shm), in 4m15s (255s)
#
@yamaya
yamaya / xcode-clang-vers
Last active November 10, 2024 04:44
Xcode clang version record
# Xcode 4.3.3
Apple clang version 3.1 (tags/Apple/clang-318.0.61) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix
# Xcode 4.3.2
Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn)
Target: x86_64-apple-darwin11.4.0
Thread model: posix