Skip to content

Instantly share code, notes, and snippets.

View hadfieldn's full-sized avatar

Nathan Hadfield hadfieldn

View GitHub Profile
@hadfieldn
hadfieldn / AbsintheSortingCodec.ex
Created January 29, 2019 20:40
Medium: AbsintheSortingCodec
defmodule AbsintheSortingCodec do
@moduledoc """
Convert the JSON output of an introspection query into deterministic JSON with types ordered alphabetically.
"""
def encode(schema, opts \\ []) do
schema
|> sorted_objects()
|> Jason.encode(opts)
end
@hadfieldn
hadfieldn / select.sql
Last active November 1, 2017 16:17
Set state to `active` for users who are admins and have transactions or active cards
/* Find admins who are in non-active state */
/* Run after `update.sql` to find how many admins still need to be reviewed */
select * from users where state = 'created' or state = 'onboarding' and company_admin = true
@hadfieldn
hadfieldn / README.md
Last active November 28, 2017 12:32
Stylesheet override for Jira RapidBoard

Installation

  • Install Stylish for Chrome.
  • Click the Stylish extension in the Chrome toolbar and select Create New Style.
  • Paste the contents of styles.css into the Code section.
  • In the Applies to selection menu, choose URLs on the domain and provide the domain of your Jira service (e.g., divvypay.atlassian.net).
  • In the top left of the style editor, give a name for your style, check Enabled, and click Save.
root@965ec8dc093a:/app# mix phoenix.routes
page_path GET / Juno.PageController :index
virtual_card_path GET /api/virtual_cards Juno.VirtualCardController :index
virtual_card_path GET /api/virtual_cards/new Juno.VirtualCardController :new
virtual_card_path GET /api/virtual_cards/:id Juno.VirtualCardController :show
virtual_card_path POST /api/virtual_cards Juno.VirtualCardController :create
virtual_card_path PATCH /api/virtual_cards/:id Juno.VirtualCardController :update
PUT /api/virtual_cards/:id Juno.VirtualCardController :update
virtual_card_path DELETE /api/virtual_cards/:id Juno.V
@hadfieldn
hadfieldn / file1.txt
Created November 18, 2015 16:17
Created via API
Demo
Verifying that +hadfieldn is my openname (Bitcoin username). https://onename.com/hadfieldn