Skip to content

Instantly share code, notes, and snippets.

View peterkappus's full-sized avatar

Peter Kappus peterkappus

View GitHub Profile
@peterkappus
peterkappus / ace_to_pug.sh
Last active July 11, 2024 17:24
Convert Ace templates to Pug for use with Hugo.
#!/bin/bash
# A very naive script to change deprecated Ace templates (https://github.com/yosssi/ace) into Pug (https://pugjs.org/api/getting-started.html) for use with Hugo (https://gohugo.io/)
# Basically a bunch of string substitutions with Perl. Not well tested. No warranty or guarnatee of any sort.
# Check if an argument is provided
if [ $# -ne 1 ]; then
echo "Usage: $0 <file_path>"
exit 1
fi
@peterkappus
peterkappus / README.md
Created March 7, 2020 22:11
Record, compress, index, and upload audio to an S3 bucket

Peter's Musical Notebook

Record audio, compress to Flac & MP3 files, create an index.html with a link to each MP3 and synch the new index and the MP3s to an S3 bucket.

Pre-requisites

  • Ruby
  • Sox
  • docker
@peterkappus
peterkappus / README.md
Last active March 6, 2020 17:00
Agile team Operations Manual

As part of a Team Charter it's helpful to have an "Operations Manual" explaining how various ceremonies are done, etc.

Here's a starting point for agile teams working in one week sprints with a heavy amount of ad-hoc requests which would otherwise be handled via a kanban system:

Storytime (Backlog Refinement)

  • Thursday afternoons and Monday morning for 1 hr (adjust frequency and timing based on team’s requirements)
  • PO brings new stories to the team in this time
  • Team discusses the top of the backlog trying to get 1-2 sprints worth of tickets into a “Ready” state (see “Definition of Ready” below)

Sprint Planning

@peterkappus
peterkappus / rec.bash
Last active March 14, 2020 11:13
Bash script for recording audio with Sox on my mac
#!/bin/bash
# For recording flac & mp3 files (with compression and silence trimming)
# Prerequisite: sox
#`brew install sox --with-lame --with-flac --with-libvorbis`
# For recording flac & mp3 files.
# Grab your laptop
# Plug in your USB sound device
@peterkappus
peterkappus / drawbar_organ.scd
Last active December 30, 2019 01:34
Super Collider treasures
(
Server.default.options.device = "BlackHole 16ch";
//Server.default.options.device = "Built-in Output";
//ServerOptions.devices;
//handle large delay sizes
//s.options.memSize= 8192*2;
//s.reboot;
@peterkappus
peterkappus / step_defs.rb
Created March 9, 2019 11:26
Some basic BDD step definitions in Capybara (Ruby)
#This file contains some useful steps for interacting with specific page elements, moving forwards and backwards in time, etc. They're pretty low-level so you might use them to get started but eventually you'll want to write your own application-specific steps.
#things to do before each scenario
Before do |scenario|
end
#and after....
After do |scenario|
end
@peterkappus
peterkappus / github_prs.gs
Created February 4, 2019 11:56
Create a Dashboard in Google Sheets showing open pull request counts from Github
//use this to get current counts of Pull Requests to put into a dashboard.
// Things to update: YOUR_USER_NAME, YOUR_ACCESS_TOKEN, YOUR_REPO_PATH (see below)
// add custom menu
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Custom GitHub Menu')
.addItem('Get User Repos','getUserRepos')
.addItem('Get rate quota','getGitHubRateLimit')
.addToUi();
@peterkappus
peterkappus / README.md
Last active January 6, 2019 23:20
HAProxy on CentOS

Installing a load balancer on CentOS

...cuz we use CentOS on the work VMs :(

Create some docker images to use as upstream hosts:

mkdir s2 s1
echo "Hello World." > s1/index.html
echo "Good evening, Pasadena." > s2/index.html
@peterkappus
peterkappus / .gitconfig
Last active July 23, 2022 17:29 — forked from betandr/gist:fe945e5837513cbf7c011a341417cb32
Handy git aliases from betandr.
[http]
proxy = http://some-proxy:80
[https]
proxy = http://some-proxy:80
[alias]
#co = checkout
#br = branch
ci = commit
st = status
co = !git checkout
@peterkappus
peterkappus / github.gs
Last active October 3, 2018 17:09
Get open github pull requests in Google Sheets - Google Script
//generic function to get JSON from a github API endpoint
function getJSON(url) {
// Your github username
username = "<USERNAME>"
// Your access token (see https://github.com/settings/tokens)
password = "<ACCESS_TOKEN>"
//basic auth using access token
var options = {};
options.headers = {"Authorization": "Basic " + Utilities.base64Encode(username + ":" + password)};