Skip to content

Instantly share code, notes, and snippets.

View kliph's full-sized avatar

Cliff Rodgers kliph

  • Philadelphia, PA
View GitHub Profile
@kliph
kliph / example.md
Created March 12, 2023 14:47
Fixes that fail
graph
    subgraph Fixes that Fail
        C -- s --> A
        B -- Delay --> C((Unintended Consequences))
        subgraph B1
            A((Problem Symptom)) -- s --> B((Fix))
            B -- o --> A
        end
 end
@kliph
kliph / example.ts
Last active April 23, 2021 01:14
Narrowing types with predicates
const A_TYPE = "a";
const B_TYPE = "b";
type AProps = {
type: typeof A_TYPE;
foo: string;
bar: number;
};
type BProps = {
@kliph
kliph / foo.md
Last active January 29, 2019 17:13
  • Item
    • Sub thing
  • Item 2
@kliph
kliph / datajawn.org
Last active June 14, 2018 13:30
Notes from #datajawn 2018

DataJawn <2018-06-13 Wed>

#datajawn on twitter

Sponsors

Drexel

CompassRed

Data Science Sense and Sensibility

@vboykis

Douglas Adams Silastic Amorfiends of Stiterax

“A story called potatoes”

Hyped data problems

@kliph
kliph / .-soccer-predict
Last active January 18, 2019 00:47
Predict Soccer win streaks
We couldn’t find that file to show.
@kliph
kliph / parse_front_matter_data.rb
Last active April 6, 2018 15:14
Analyze tags in blogs from Jekyll-style front-matters
require 'front_matter_parser'
require 'csv'
# Usage: ParseFrontMatterData.new.save_csv
# Will create `data.csv` in the current working directory
class ParseFrontMatterData
attr_accessor :blog_files, :front_matters
def initialize
@blog_files = get_blog_files
@kliph
kliph / gist:dd59bfeee06ea43e70fec76b13597b34
Created February 12, 2018 14:47
Calculate the base64-encoded sha256 hash of a file's contents
shasum -a 256 Gemfile.lock | awk '{ print $1 }' | openssl base64
git ls-tree --full-tree -r HEAD | awk '{ print $4 "," $3 }' >> closures.csv
cat closures.csv | awk -F "," '{ print $1 }' | xargs -L 1 git log --follow --diff-filter=A --find-renames=40% -- | ag commit | awk '{ print $2 }' > creations
@kliph
kliph / .emacs.local
Last active April 3, 2024 13:53
My local emacs config. See https://github.com/promptworks/dotfiles for base emacs configuration.
;; -*- mode: emacs-lisp -*-
;;; Emacs is a platform written in 1976 (yes, almost half a century ago) for
;;; writing software to make you more productive, masquerading as a text
;;; editor. -- Steve Yegge
;;; Use Paredit
(unless (package-installed-p 'paredit)
(package-install 'paredit))
(require 'paredit)
@kliph
kliph / witch-wands.rb
Created October 28, 2017 23:05
Dining witches with Mutex locks
require 'thread'
class Witch
def initialize(name, left_wand, right_wand)
@name = name
@left_wand = left_wand
@right_wand = right_wand
while true
conjure
dine