Skip to content

Instantly share code, notes, and snippets.

@muness
muness / redshift_date_dim.sql
Last active October 22, 2024 19:37
Redshift Date Dimension
-- Potentially quirky when it comes to week numbers.
BEGIN TRANSACTION;
DROP TABLE IF EXISTS numbers_small;
CREATE TABLE numbers_small (
number SMALLINT NOT NULL
) DISTSTYLE ALL SORTKEY (number
);
INSERT INTO numbers_small VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
@muness
muness / sqlite2pg.sh
Last active April 3, 2017 17:23 — forked from eclubb/sqlite2pg.sh
Script to import SQLite3 database into PostgreSQL
#!/bin/sh -ex
# This script will migrate schema and data from a SQLite3 database to PostgreSQL.
# Schema translation based on http://stackoverflow.com/a/4581921/1303625.
# Some column types are not handled (e.g blobs).
SQLITE_DB_PATH=$1
PG_DB_NAME=$2
PG_USER_NAME=$3
@muness
muness / find_app
Last active April 20, 2016 20:25
tiny script for use with mas (https://github.com/argon/mas) to find app IDs through the cli with more details than mas search
curl --silent https://itunes.apple.com/search?entity=macSoftware\&term=$1\&attribute=allTrackTerm | jq '.results | .[] | {id: .trackId, name: .trackName, description: .description}'
### Keybase proof
I hereby claim:
* I am muness on github.
* I am muness (https://keybase.io/muness) on keybase.
* I have a public key whose fingerprint is F608 BC76 3CA2 D09D 4EAA 938D F04C 61AE 128A AB1D
To claim this, I am signing this object:
@muness
muness / passpack_to_lastpass.py
Last active August 29, 2015 14:12
Passpack to Lastpass format converter
#!/usr/bin/python
# Based on https://plus.google.com/+TonyScelfo/posts/LvuRq9mToR1
import csv
in_file = open('in.csv', 'rb')
out_file = open('out.csv', 'wb')
reader = csv.reader(in_file, delimiter=',', quotechar='"')
writer = csv.writer(out_file, delimiter=',', quotechar='"')
xml_out.Trips do
for page in (1..pages)
past_trips = t.list.trip({'past' => 'true', 'include_objects' => 'false', 'traveler' => 'true', "page_size" => "30", "page_num" => page})
node = Nokogiri::XML(past_trips.to_xml.to_s)
xml_out << node.xpath("//Trip").to_xml
end
end

Keybase proof

I hereby claim:

  • I am muness on github.
  • I am muness (https://keybase.io/muness) on keybase.
  • I have a public key whose fingerprint is 2A4A 21E1 2459 19BC 3839 DB07 D305 9DA2 9A48 003E

To claim this, I am signing this object:

@muness
muness / gist:5878434
Last active January 15, 2017 22:58
Notes from David Ratcliffe's webcast on empowering leaders
Empowering IT Leaders
David Ratcliffe webcast, 2013-06-27 @ 1pm ET
webcast: https://www.brighttalk.com/webcast/534/78901
slides, notes: http://public.brighttalk.com/resource/core/16767/david-ratcliffe---adding-value-to-your-itsm-organization_25229.pdf
@pinkerdavid
Audience:
In IT or software
You want to do something positive for your employer
Three main topics:
Coordinating across teams - today
Integrating teams output
Maintaining system integrity
Why is coordinating across teams so hard?
* Dependencies lead to fits and starts
Kinds of dependencies:
* Functional dependencies (a then b then c) - story mapping helps with that.
#!/bin/sh
# wire this in cron with something like this:
# 13,57,43,27 * * * * ~/bin/cal_im_reminder
export PATH="$HOME/.rbenv/bin:$PATH" ; eval "$(rbenv init -)";
export TZ='America/New_York' # adjust to your timezone!
~/bin/gcalcli agenda --calendar <calendars from which you want IM reminders> --tsv | ~/bin/gcalcli_parse_tsv 10 | sendxmpp <personal gmail> -t <xmpp account you're logged into normally. for me that's my work account>