Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
work work work

Matthew Berryman matthewberryman

💭
work work work
View GitHub Profile
View CORE.BA3
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 Oct 7, 2020 — 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.
View murderbot.js
async function loadItems() {
let url = "https://midsomerplots.acrossthecloud.net/plot?characterLimit=200";
let req = new Request(url);
let json = await req.loadJSON();
return json;
}
function createWidget(json) {
let w = new ListWidget()
View rstudiolatex.sh
#!/usr/bin/env bash
latexmk -pv- -quiet -pdf -xelatex $@
View 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'])
{
View 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*'
View keybase.md

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:

View 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
batch transcode using AWS Elastic Transcoder
View transcode.js
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',
View aws-codebuild-extras.sh
#!/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
@matthewberryman
matthewberryman / serverless_policy.json
Created Mar 22, 2018
IAM policy for using serverless in codebuild
View serverless_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1483564261000",
"Effect": "Allow",
"Action": [
"iam:GetRole",
"iam:CreateRole",
"iam:DeleteRole",