Skip to content

Instantly share code, notes, and snippets.

View BitBuilder's full-sized avatar

Bit Builder BitBuilder

View GitHub Profile
@jamesbar2
jamesbar2 / postal-codes.json
Last active June 27, 2024 09:30 — forked from matthewbednarski/postal-codes.json
Global postal codes regex formats
[{
"Note": "The first two digits (ranging from 10–43) correspond to the province, while the last two digits correspond either to the city/delivery zone (range 01–50) or to the district/delivery zone (range 51–99). Afghanistan Postal code lookup",
"Country": "Afghanistan",
"ISO": "AF",
"Format": "NNNN",
"Regex": "^\\d{4}$"
}, {
"Note": "With Finland, first two numbers are 22.",
"Country": "Åland Islands",
"ISO": "AX",
@esserj
esserj / InternationalBankAccountNumber.php
Last active January 9, 2023 21:30
Validated formats and parses iban's as per the specifications prefered way, found here: https://www.swift.com/sites/default/files/resources/swift_standards_ibanregistry.pdf
<?php
/**
* @author Esser Jan
* @license MIT
* @example InternationalBankAccountNumber::createFromString($someString)
* @example InternationalBankAccountNumber::createFromString($someString)->toFormattedString() // space separated
* @example InternationalBankAccountNumber::createFromString($someString)->toFormattedString('-', 4, true) // IBAN prefixed - separated
*/
class InternationalBankAccountNumber
{
'OpenOffice Basic macro for exporting a .ods spreadsheet to JSON (and CSV)
'Project-specific formating I implemented: cull empty or "0" entries, '^' as separator value for the csv
REM ***** BASIC *****
Sub Main
'First export to CSV which we will later use as the source for the export to json
Dim Propval(1) as New com.sun.star.beans.PropertyValue
Propval(0).Name = "FilterName"
@todgru
todgru / starttmux.sh
Last active May 27, 2024 08:20
Start up tmux with custom windows, panes and applications running
#!/bin/sh
#
# Setup a work space called `work` with two windows
# first window has 3 panes.
# The first pane set at 65%, split horizontally, set to api root and running vim
# pane 2 is split at 25% and running redis-server
# pane 3 is set to api root and bash prompt.
# note: `api` aliased to `cd ~/path/to/work`
#
session="work"
@tobert
tobert / p2d.sh
Last active May 27, 2020 15:59
Physical-to-Docker conversion script ... as in, these are the steps I went through, but this script is not something you want to run on any machine you care about. I've removed employer-specific stuff from this copy.
#!/bin/bash
#
# This is really just notes, but I put them in a shell script so I get
# free highlighting and easy cut/paste (in and out).
#
echo "Don't run this script! It's meant to be read. It will destroy your system!"
exit 1
RAW="lucid-amd64-cdh3u4-raw"