Skip to content

Instantly share code, notes, and snippets.

View matthewberryman's full-sized avatar
💭
work work work

Matthew Berryman matthewberryman

💭
work work work
View GitHub Profile
##
## mclapply.hack.R
##
## Nathan VanHoudnos
## nathanvan AT northwestern FULL STOP edu
## July 14, 2014
##
## A script to implement a hackish version of
## parallel:mclapply() on Windows machines.
## On Linux or Mac, the script has no effect
@matthewberryman
matthewberryman / CORE.BA3
Created February 20, 2021 22:48
HISAC-core
0 GOTO 100
1 REM LET T$ = "test desc" : LET S = 0 OR 1 : GOSUB 1
2 IF S THEN PRINT ".";
3 IF NOT S THEN INVERSE : PRINT " Test ";T$;" Failed "; : NORMAL : PRINT ""; : F = F + 1
4 TE = TE + 1 : TS = TS + (NOT NOT S) : S = 0 : RETURN
100 REM Pre-test for CLEAR
110 A = 1 : A$ = "a" : A(1) = 2 : A$(1) = "b" : CLEAR
200 REM Feature Detection
210 LR = 0 : ONERR GOTO 220
211 GR : LR = 1
@matthewberryman
matthewberryman / murderbot.js
Last active January 14, 2023 08:18 — forked from alldritt/murderbot.js
A script for Scriptable (https://apps.apple.com/us/app/scriptable/id1405459188) that creates a Midsummer Murders Bot (https://twitter.com/midsomerplots) iOS 14 Widget.
async function loadItems() {
let url = "https://midsomerplots.acrossthecloud.net/plot?characterLimit=200";
let req = new Request(url);
let json;
try {
json = await req.loadJSON();
} catch (e) {
throw e;
}
return json;
#!/usr/bin/env bash
latexmk -pv- -quiet -pdf -xelatex $@
@matthewberryman
matthewberryman / vary_headers.js
Created October 4, 2019 23:02
vary_headers.js
'use strict';
// If the response lacks a Vary: header, fix it in a CloudFront Origin Response trigger.
exports.handler = (event, context, callback) => {
const response = event.Records[0].cf.response;
const headers = response.headers;
if (!headers['vary'])
{
@matthewberryman
matthewberryman / buildR.sh
Last active February 10, 2020 01:24
buildR.sh
#!/usr/bin/env bash
RVERSION=3.6.2
MKLVERSION=2020.0-088
curl https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB | sudo apt-key add -
sudo sh -c 'echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list'
sudo apt-get update && sudo apt-get -y upgrade
# remove old MKL version - safe to ignore any warnings. Also clean up packages.
sudo apt-get -y remove 'intel-comp-l-all-var*' 'intel-comp-nomcu-vars*' 'intel-conda-index-tool*' 'intel-conda-intel-openmp*' 'intel-conda-mkl*' 'intel-conda-tbb*' 'intel-mkl*' 'intel-openmp*' 'intel-psxe-common*' 'intel-tbb-libs*'

Keybase proof

I hereby claim:

  • I am matthewberryman on github.
  • I am shenmaxiu (https://keybase.io/shenmaxiu) on keybase.
  • I have a public key ASAF0lEfkgDogte9y-zF0hNkmCX3O1KtAYfCxK0zTAXPXQo

To claim this, I am signing this object:

@matthewberryman
matthewberryman / bootstrap.sh
Last active May 26, 2019 00:00
bootstrap.sh
#!/usr/bin/env bash
sudo apt update
sudo apt -y upgrade
sudo apt -y install build-essential gfortran cmake git curl zsh
cd $HOME
git clone https://github.com/matthewberryman/oh-my-zsh .oh-my-zsh
ln -s .oh-my-zsh/templates/zshrc.linux .zshrc
sudo chsh -s /bin/zsh $USER
@matthewberryman
matthewberryman / transcode.js
Created May 18, 2018 00:45
batch transcode using AWS Elastic Transcoder
const AWS= require('aws-sdk');
AWS.config.update({region: 'ap-southeast-2'}); // set your region here
const elastictranscoder = new AWS.ElasticTranscoder();
const s3 = new AWS.S3();
var params = {
Bucket: 'my-bucket',
#!/bin/bash
export CI=true
export CODEBUILD=true
export CODEBUILD_GIT_BRANCH=`git symbolic-ref HEAD --short 2>/dev/null`
if [ "$CODEBUILD_GIT_BRANCH" == "" ] ; then
CODEBUILD_GIT_BRANCH=`git branch -a --contains HEAD | sed -n 2p | awk '{ printf $1 }'`
export CODEBUILD_GIT_BRANCH=${CODEBUILD_GIT_BRANCH#remotes/origin/}
fi