Skip to content

Instantly share code, notes, and snippets.

@phrohdoh
phrohdoh / _introduction.md
Last active September 6, 2018 17:49
Game of 35

The Game of 35

This "game" aims to give you and/or your team(s) a general sense of what should be done next.

It can be used for many parts of life! Examples:

  • Which bugs/features should a software team work on?
  • Which chores around the house should I do?

@phrohdoh
phrohdoh / aliases.md
Created August 24, 2018 21:57
git aliases

Add aliases by running each of the following commands once:

$ git config --global alias.rel "rev-parse --show-prefix"
$ git config --global alias.root "rev-parse --show-toplevel"

Example usage:

@phrohdoh
phrohdoh / audience_terms.json
Created July 13, 2018 13:09
Search engine term generator for finding audience watering holes (based on terms *you come up with*) [30x500]
[
[
".NET",
".NET Core",
"ASP.NET",
"ASP.NET Core",
"C#",
"F#",
"VB.NET"
],
@phrohdoh
phrohdoh / magic.md
Created March 30, 2018 16:59
git-fu: append to commit messages & generate github commit links

Current commit messages:

commit 6a15c88f851efb900d8799e65373d9472654d0e4 (HEAD -> master)
Author: Taryn
Date:   Fri Mar 30 09:27:07 2018 -0700

    Foo'd the bar

commit 2c3c44731ef93060ffe69e802ed8d3e2f3c02ca0
@phrohdoh
phrohdoh / language.dll.txt
Created February 11, 2018 17:07
Age of Empires (1997) language.dll
{
101: "1",
102: "Copperplate Gothic Light",
103: "Comic Sans MS",
104: "Arial",
110: "Copperplate Gothic Light",
111: "12",
112: "B",
113: "Copperplate Gothic Light",
114: "21",
@phrohdoh
phrohdoh / loaddata-helper.jq
Created February 3, 2018 05:20
Filter out fixture object via jq for django's `loaddata` command
# Requires: jq 1.5
# Steps to use this filter:
# 1) dump your db via `python manage.py dumpdata -o mydata.json`
# 2) delete your db entirely via `rm db.sqlite3`
# 3) create a new db via `python manage.py migrate`
# 4) modify the `blacklist` below to include any `model`s you don't want to re-import (ones that `migrate` added, for example)
# 5) run your `mydata.json` file through this filter file like so `cat mydata.json | jq -f loaddata-helper.jq`, verify the output
# 6) run the above again this time redirecting stdout to a file (possibly overwriting your original json) `cat mydata.json | jq -f loaddata-helper.jq > myfixture.json`
# 7) create a django 'fixture' (which app you put it in doesn't matter, afaik) `mkdir -p apps/someapp/fixtures/ && mv myfixture.json $_`
@phrohdoh
phrohdoh / snake_to_pascal.bash
Created January 22, 2018 20:30
Convert snake-case string to pascal-case and print as C# properties
function snake_to_pascal() {
# NOTE: Only use `gsed` if you are running macOS (install `gsed` via `brew install gnu-sed`),
# else change to `sed`.
echo "$1" | gsed 's/_\([a-z]\)/\U\1/g;s/^\([a-z]\)/\U\1/g' | xargs printf "[JsonProperty(\"$1\")]\npublic object %s { get; set; }\n"
}
snake_to_pascal 'id'
snake_to_pascal 'first_name'
snake_to_pascal 'last_name'
snake_to_pascal 'age'
@phrohdoh
phrohdoh / CLA.md
Last active October 19, 2017 16:11 — forked from CLAassistant/SAP_CLA
Individual Contributor License Agreement

Individual Contributor License Agreement

Thank you for your interest in contributing to open source software projects (“Projects”) made available by Taryn Hill (“Taryn”). This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to Taryn in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact taryn@phrohdoh.com.

You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.

Copyright License. You hereby grant, and agree to grant, to Taryn a non-exclusive, perpetual, irrevocable, worldwide, fully-pa

@phrohdoh
phrohdoh / work_queue.rs
Created August 30, 2017 13:55 — forked from NoraCodes/work_queue.rs
An example of a parallel work scheduling system using only the Rust standard library
// Here is an extremely simple version of work scheduling for multiple
// processors.
//
// The Problem:
// We have a lot of numbers that need to be math'ed. Doing this on one
// CPU core is slow. We have 4 CPU cores. We would thus like to use those
// cores to do math, because it will be a little less slow (ideally
// 4 times faster actually).
//
// The Solution:
@phrohdoh
phrohdoh / Cargo.toml
Last active August 28, 2017 12:12
Run a Mono/CIL executable via Rust
[package]
authors = ["Taryn Hill <taryn@phrohdoh.com>"]
name = "libdotnet"
version = "0.1.0"
[dependencies]
libc = "0.2.29"
libloading = "0.4.0"