This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env Rscript | |
suppressPackageStartupMessages({ | |
library(globals) | |
library(readr) | |
library(stringr) | |
library(rex) | |
library(magrittr) | |
library(rlang) | |
library(knitr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file defines a decorator '@log_to()' that logs every call to a | |
# function, along with the arguments that function was called with. It | |
# takes a logging function, which is any function that accepts a | |
# string and does something with it. A good choice is the debug | |
# function from the logging module. A second decorator '@logdebug' is | |
# provided that uses 'logging.debug' as the logger. | |
from __future__ import print_function | |
from functools import wraps | |
from inspect import getcallargs, getargspec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Rsync Filter for $HOME | |
# Universal excludes -- These apply to all subdirs | |
- [Cc]ache | |
- temp | |
- tmp | |
- octave-core | |
# Emacs temp files | |
- .#* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import textwrap | |
def refill_docstring(func, *args, **kwargs): | |
"""Fix the text wrapping in a function's docstring. | |
This can be useful when creating doc strings dynamically. | |
Additional args are options to textwrap.TextWrapper.""" | |
wrapper = textwrap.TextWrapper(*args, **kwargs) | |
# Remove trailing whitespace from all lines |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# shortsleep-unlock.py - Keep GNOME unlocked on short lid closes | |
# Copyright (C) 2021 Ryan C. Thompson <rct@thompsonclan.org> | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# -*- mode:python -*- | |
#PBS -l nodes=1:ppn=8,mem=30gb | |
''''/bin/true | |
# This is bash code to set up the environment | |
echo "Hello from bash!" | |
echo "Args are: $@" | |
# Bash setup code ends here | |
python - "$@" <<EOF | |
''' # Python starts here ''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# -*- mode:R -*- | |
#PBS -l nodes=1:ppn=8,mem=30gb | |
'\' >/dev/null 2>&1 || true | |
# This is bash code to set up the environment | |
echo "Hello from bash!" | |
echo "Args are: $@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#$ -cwd | |
#$ -l jabba,mem_free=10G,h_vmem=2G,h_fsize=1G | |
#$ -N approach1b | |
#$ -pe local 20 | |
#$ -m e | |
echo "**** Job starts ****" | |
date |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(ggrepel) | |
library(dplyr) | |
library(stringr) | |
library(scales) | |
## https://github.com/tidyverse/ggplot2/issues/980 | |
mysqrt_trans <- function() { | |
trans_new("mysqrt", | |
transform = base::sqrt, | |
inverse = function(x) ifelse(x<0, 0, x^2), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## License: WTFPL | |
library(reshape2) | |
library(matrixStats) | |
library(ggplot2) | |
library(magrittr) | |
library(dplyr) | |
## You also need the Hmisc package installed, but I don't load it | |
## because of namespace clashes with dplyr | |
## Enumerate all possible 4d6 rolls, then order each row from high to |
NewerOlder