Skip to content

Instantly share code, notes, and snippets.

@phrohdoh
phrohdoh / snippets.clj
Last active May 26, 2021 11:39
assorted clojure snippets
;; -----------------------------------------------------------------------------
(require '[clojure.spec.alpha :as spec]
#_'[clojure.string :as str]
#_'[clojure.edn :as edn]
#_'[clojure.java.io :as io]
;; non-stdlib deps
'[clojure.spec.gen.alpha :as spec-gen] ;; org.clojure/test.check 1.1.0
'[clojure.data.json :as json] ;; org.clojure/data.json 2.3.1
#_'[datascript.core :as ds] ;; datascript 1.1.0
#_'[datascript.transit :as dsts]) ;; datascript-transit 0.3.0
@phrohdoh
phrohdoh / _.md
Last active August 4, 2020 15:22
AutoPets Whisker mobile app snippets

fake activities for lib/litter/status/litter_status_tab.dart's _buildRecentActivitySection

    final fakeActivities = List<LitterRobotActivity>.from(
      LitterRobotUnitStatus.values.map(
        (unitStatus) => LitterRobotActivity(
          litterRobotId: 'x',
          unitStatus: unitStatus,
          timestamp: DateTime.now()
              .subtract(Duration(seconds: Random().nextInt(60 * 60 * 8))),
@phrohdoh
phrohdoh / ynab-cli.py
Created April 30, 2019 17:20
A highly-specific Python 3 script operating on YNAB API JSON
#!/usr/bin/env python3
####
#
# Invoke like this:
#
# $ ./ynab.py ./data.json
#
# -or-
#
@phrohdoh
phrohdoh / ynab_v1.openapi_v3.yaml
Created April 30, 2019 15:22
YNAB API v1 OpenAPI v3 YAML
openapi: 3.0.0
info:
description: Our API uses a REST based design, leverages the JSON data format, and relies
upon HTTPS for transport. We respond with meaningful HTTP response codes and
if an error occurs, we include error details in the response body. API
Documentation is at https://api.youneedabudget.com
version: 1.0.0
title: YNAB API Endpoints
tags:
- name: User
@phrohdoh
phrohdoh / ynab.openapi.yaml
Last active April 30, 2019 15:21
YNAB API v1 OpenAPIv2 YAML
swagger: '2.0'
info:
description: 'Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.youneedabudget.com'
version: 1.0.0
title: YNAB API Endpoints
schemes:
- https
host: api.youneedabudget.com
basePath: /v1
tags:
@phrohdoh
phrohdoh / interceptor.bash
Last active April 8, 2019 15:34
Intercept process I/O via `tee` and write to customizable log file locations
#!/usr/bin/env bash
##### What / Why / How #####
#
# - What
#
# This script makes it simple to intercept, typically for viewing by a human,
# the stdin and stdout of a process, such as a language server binary.
#
#
@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