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
@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;
##
## 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 / setup_rds_postgis.sql
Last active January 2, 2021 11:53
Setup postgis in Amazon RDS
-- taken from http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.html#Appendix.PostgreSQL.CommonDBATasks.PostGIS
create extension postgis;
create extension fuzzystrmatch;
create extension postgis_tiger_geocoder;
create extension postgis_topology;
alter schema tiger owner to rds_superuser;
alter schema tiger_data owner to rds_superuser;
alter schema topology owner to rds_superuser;
@matthewberryman
matthewberryman / 01-http_basic_auth.config
Created February 13, 2017 11:10
config file for adding basic auth to an elastic beanstalk nginx config
files:
/etc/nginx/.htpasswd:
mode: "000644"
owner: root
group: root
content: |
username:passwd_hash
# use httpasswd -c -b password_file desired_username desired_password
# and copy and paste the line from that in to username:password_hash
#!/usr/bin/env bash
latexmk -pv- -quiet -pdf -xelatex $@
@matthewberryman
matthewberryman / requirements.txt
Created October 20, 2017 00:53
requirements.txt for librosa on RPi3 with llvm-3.8
audioread==2.1.5
cryptography==1.7.1
decorator==4.0.11
idna==2.2
joblib==0.11
keyring==10.1
keyrings.alt==1.3
librosa==0.5.1
llvmlite==0.15.0
numba==0.30.1
@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',
@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*'
@matthewberryman
matthewberryman / greengrass.service
Last active November 25, 2019 11:42
greengrass systemd
[Unit]
Description=greengrass daemon
After=network.target
[Service]
ExecStart=/greengrass/ggc/core/greengrassd start
Type=simple
RestartSec=2
Restart=always
User=root