Skip to content

Instantly share code, notes, and snippets.

View pbrdmn's full-sized avatar

Philip Boardman pbrdmn

View GitHub Profile
require './ctb'
require 'csv'
## New CTB Instance, write empty file
ctb = CTB.new("Organisation", "ID_123", "A11111111")
ctb_output_file = "ctb-#{Time.now.strftime("%Y%m%d")}.txt"
File.write(ctb_output_file, '');
# Define input files
svb_input_file = 'svb.txt'
@pbrdmn
pbrdmn / ach.rb
Last active March 14, 2023 02:08
Create ACH (Automated Clearing House) files for dispatch into the NACHA network
class ACH
RECORD_SIZE = 94 # Always "094" because every record contains 94 characters.
PRIORITY_CODE = "01"
HEADER_RECORD_TYPE_CODE = "1"
BATCH_HEADER_RECORD_TYPE_CODE = "5"
ENTRY_RECORD_TYPE_CODE = "6"
BATCH_CONTROL_RECORD_TYPE_CODE = "8"
FOOTER_RECORD_TYPE_CODE = "9"
BLOCKING_FACTOR = 10
FORMAT_CODE = "1"
/*
Ascii banana
Writing bits from key state and typing characters
*/
#include "Keyboard.h"
#define DEBOUNCE_TIME 50
#define NUM_KEYS 8
int pins[] = { 7, 8, 9, 10, 16, 14, 15, 18, };
@pbrdmn
pbrdmn / hex_banana.c
Last active December 16, 2022 09:48
Hex Banana - Demonstrating tap/hold behaviour with on/off debouncing.
/*
Hex Banana
Demonstrating tap/hold behaviour with on/off debouncing.
*/
#include "Keyboard.h"
#define DEBOUNCE_TIME 50
#define HOLD_TIME 300
@pbrdmn
pbrdmn / banana.c
Last active December 16, 2022 09:49
Banana - Firmware for banana macro pad
/*
Banana
Demonstrating tap behaviour with on/off debouncing.
*/
#include "Keyboard.h"
#define DEBOUNCE_TIME 50
#define TIMEOUT 2000
@pbrdmn
pbrdmn / slack-new-unread-messages.js
Last active February 17, 2022 04:41
Automatically show new messages in Slack "All unread" channel in a browser
setInterval(()=>{
document.querySelector('button.c-button.c-button--primary.c-button--medium')?.textContent.includes('new message')?.click();
document.querySelector('button.c-button-unstyled.p-ia__view_header__button.p-ia__view_header__button--with_label')?.textContent.includes('new message')?.click();
}, 1000);
@pbrdmn
pbrdmn / keybase.md
Last active October 9, 2022 05:02
Keybase proof

Keybase proof

I hereby claim:

  • I am pbrdmn on github.
  • I am pbrdmn (https://keybase.io/pbrdmn) on keybase.
  • I have a public key whose fingerprint is 8F5C DA07 3921 34D5 E048 A420 BB23 E2A4 EA5D 394A

To claim this, I am signing this object:

@pbrdmn
pbrdmn / localStorage.js
Last active June 22, 2017 14:54
Storing (and retrieving) an array of objects in localStorage with Angularjs
/* Initial list */
$scope.tasks = [
{
title: 'Create a List',
description: 'Create my first list',
completed: true,
picture: null
},
{
title: 'Complete list',