Skip to content

Instantly share code, notes, and snippets.

View hoomand's full-sized avatar

Bijan Hoomand hoomand

View GitHub Profile
@hoomand
hoomand / flowkey.js
Created January 1, 2021 07:27 — forked from amcolash/flowkey.js
Noteflight auto transcribe
// Find the sheet music images on the page
const elements = document.getElementsByClassName('split-image');
// Check that there are actually images on the page
if (elements.length === 0) {
console.error('No images found');
} else {
// If images were found, extract the base url from the 1st one
const imageUrl = elements[0].src;
const imageIdMatch = /\/sheets\/([\w\d]+)\//;
@hoomand
hoomand / db_backup.rb
Last active May 27, 2018 07:44
Ruby OptParse example
#!/usr/bin/env ruby
# A sample use of optparse to parse command line arguments/flags
# Sample run:
# $> ./db_backup.rb -u bijan.hoomand --password blahblah -s local --verbosity 3
# {:user=>"bijan.hoomand", :password=>"blahblah", :server=>"127.0.0.1", :verbosity=>3}
#
# $> ./db_backup.rb -u bijan --password blahblah --server dev -v 5 --iteration
# ./db_backup.rb:40:in `<main>': invalid argument: -u bijan (OptionParser::InvalidArgument)
@hoomand
hoomand / .pgpass
Last active May 18, 2018 04:02 — forked from davehughes/.pgpass
psql connection aliasing/management
# alias:northwind
db1.example.com:5432:northwind:postgres:hunter2
# alias:mainframe
db1.example.com:5432:mainframe:dave:password123
db1.example.com:5432:unaliased:postgres: