Skip to content

Instantly share code, notes, and snippets.


therightstuff therightstuff

View GitHub Profile
therightstuff /
Created Jul 10, 2021
Node.js script to convert FNB Credit Card statements from PDF to CSV

Convert PDF FNB Credit Card statements to CSV compatible with cheque account CSV format

A quick-hack node.js script that converts FNB (First Nation Bank of South Africa) PDF Credit Card statements to a CSV format that's similar enough to the format of their cheque account CSVs to enable the budgie-feeder parser to ingest it.

NOTE: results may vary, generated CSV files must be reviewed before use.

therightstuff /
Last active Apr 12, 2021
Safe atomic file writes for JSON and YAML in Python 3
import json
import os
import shutil
import stat
import tempfile
import yaml
def copy_with_metadata(source, target):
"""Copy file with all its permissions and metadata.
therightstuff /
Last active Feb 19, 2021
Generate a secure python password with no dependencies
A simple password generator that produces secure passwords of a given length
without requiring the installation of additional modules.
The four valid password characters classes - lowercase, uppercase, digits and
punctuation - are inserted randomly into the password using cryptographically
strong random numbers from the secrets module until the password length
requirement is met, ensuring that each of the classes is included in the password.
Password strength verified with
therightstuff /
Last active Dec 10, 2020
Batch / bulk upload script for NuGet private repo hosted on Nexus
# to be run with git-bash on a Windows machine
# based on
# download latest version of nuget.exe for Windows x86 Commandline
# from into the current directory
# retrieve NuGet API Key from Nexus by clicking on your profile,
# the side bar menu should show "NuGet API Key"
show_usage() {
therightstuff / sample.js
Last active Nov 28, 2020
Convert GUID (UUID) to integer number in Javascript
View sample.js
// see
const uuidParse = require('uuid').parse;
let convertGuidToInt = (uuid) => {
// parse accountId into Uint8Array[16] variable
let parsedUuid = uuidParse(uuid);
console.log(`uuid ${uuid} parsed successfully`);
// convert to integer - see answers to
let buffer = Buffer.from(parsedUuid);
therightstuff / .netrc
Created Jul 28, 2020
Private PyPI repository access configurations
View .netrc
therightstuff /
Last active Jun 23, 2020
Code samples for A templated guide to AWS serverless development with CDK
therightstuff / fairShuffle.js
Last active Mar 28, 2020
A list shuffle method that ensures every item is consumed
View fairShuffle.js
A shuffler that ensures that no items in a list (a music playlist in particular) are left behind.
When an item in the current shuffle group is used, it is moved to the next shuffle group and the next shuffle group is reshuffled.
Shuffling the current group doesn't affect the number of items remaining in the current shuffle group.
Shuffling the current group when there's only one item remaining will have no effect, the item must be consumed (to preserve fairness) and only then will be shuffled in to the next group
therightstuff /
Last active Mar 24, 2020
add a parent commit to an existing git commit
# add a parent commit to the specified commit, ideal
# for establishing the other parent of a squashed merge
# lifted from
set -ex
therightstuff / create_db.js
Created Sep 23, 2019
@mysql/xdevapi node.js example: (re)create mysql database, test table insert, select and delete
View create_db.js
var mysqlx = require('@mysql/xdevapi');
const MIGRATIONS_USER = 'migrationsuser';
var server = {
host : 'localhost',
user : 'intendeduser',
database : 'mydatabase',
password : 'mypassword'