Skip to content

Instantly share code, notes, and snippets.

@mmrobins
mmrobins / gist:d6dc2f58f9ee097b5f86fdf768b59816
Last active April 21, 2020 01:02
kalimba pachabel canon
3. 2. 1. 7 6 5 6 7 1.
7 6 5 4 3 4 2 1. 3. 5.
4. 3. 1. 3. 2. 1. 6 1.
5. 4. 6.
5. 4. 3. 1. 2 7 1. 3.
5. 5. 6. 4. 5. 3. 1. 1..
1.. 7. 1.. 7. 1.. 1. 7 5. 2.
3. 1. 1.. 7. 6. 7. 3. 5. 6.
4. 3. 2. 4. 3. 2. 1. 7 6 5
4 3 2 4 3 2 1. 2. 3.
@mmrobins
mmrobins / gist:4e4d8577f2b0a8c3175ce0a89a036b42
Created December 10, 2019 07:29
set photo exif timestamp based on directory name
for dir in */; do;
year=`echo $dir | sed 's/\([0-9]\{4\}\).*/\1/'`
month=`echo $dir | sed 's/[0-9]\{4\}\([0-9]\{2\}\).*/\1/'`
echo "year $year"
echo "month $month"
exiftool -P -overwrite_original_in_place "-datetimeoriginal=$year:$month:01 12:00:00" "$dir"/*
done
~/bin/heroku_app_env
------
#!/bin/bash
apps=$(heroku apps --all --json --space trailhead | jq -r '.[] | "\(.name)"' | egrep $1)
for app in ${apps[@]}; do
echo $app
heroku config --app $app | egrep $2
echo
#!/usr/bin/env ruby
# this script will delete ECR images that are older than N days
require 'date'
require 'json'
# customize this script
repo = 'passport'
delete_if_older_than = 180 # days
@mmrobins
mmrobins / gist:14f814da9c3f7e4d22cbbd94ae4b6668
Created September 19, 2018 17:54
first passport data issue query in ecto
alias Db.Salesforce.{FieldMapping, Organization, SObjectType}
alias Db.Repo
import Ecto.Query
mappings =
from(
[fm, o, t, f, af] in FieldMapping.joined_query(),
where: t.name == "lead",
select: [af.name, t.name, o.code, fragment("group_concat(?)", f.field)],
group_by: [af.name, t.name, o.code],
@mmrobins
mmrobins / ecr-cleanup.rb
Created August 27, 2018 23:56
ecr-cleanup
#!/usr/bin/env ruby
# this script will delete ECR images that are older than N days
require 'date'
require 'json'
# customize this script
repo = ARGV[0]
delete_if_older_than = ARGV[1].to_i # days
>> { "foo": "bar" }
SyntaxError: unexpected token: ':'[Learn More] debugger eval code:1:7
>> var baz = { "foo": "bar" }
undefined
>> baz
Object { foo: "bar" }
What do accountants suffer from that ordinary people don't? Depreciation
Where do homeless accountants live? In a tax shelter
It's accrual world
How does Santa's accountant value his sleigh? Net Present Value
While talking about journal entries "dear journal, been talking about accounting for hours, FML"
There's no accounting for taste - or taste for accounting. One of those
What did Scotty say when Kirk asked him to process payroll? Account do it captain
What does the accountant say before getting off the subway? Mind the GAAP
Our accounting team is a credit to the company
We're all just COGS in the journal entry
@mmrobins
mmrobins / gist:567cf5545ffc1b98363fb12b54a043e0
Created February 6, 2017 20:08
Matt's "technical" "phone" interview process
Goal is to get people with the following traits:
Good technical communication
Good reaction to feedback
Eager to learn
NOT looking for:
ability to solve arbitrary white board problems in a short time
ability to write code outside their normal editor
memorization of algorithms to common coding challenges
These questions require the interviewer to do a little prep work ahead of
result = Message.all.map do |m|
body = JSON.parse(m.body)
action = m.action
date = if m.action == 'new_customer_return'
body["customer_return"]["receipt_date"]
elsif m.action == 'shipment_shipped'
body["shipped_at"]
elsif action == 'shipment_canceled'
body["canceled_at"]
elsif action == 'order_fulfilled'