Skip to content

Instantly share code, notes, and snippets.

View kevlarr's full-sized avatar

kevin kevlarr

  • North Shore, MA
View GitHub Profile
"""
See:
https://aws.amazon.com/premiumsupport/knowledge-center/decode-verify-cognito-json-token/
https://medium.com/datadriveninvestor/jwt-authentication-with-fastapi-and-aws-cognito-1333f7f2729e
"""
from datetime import datetime
import logging
from os import environ
import re
from typing import Any, Dict, List, Optional
@kevlarr
kevlarr / README.md
Last active November 13, 2019 04:28
SQL-y things

asdf

@kevlarr
kevlarr / .psqlrc
Last active November 8, 2019 19:16
psql config
\set QUIET 1
-- Don't page output that's bigger than screen,
-- because scrolling is a thing that works
\pset pager off
-- Auto-expand when too much data for table view
\x auto
-- Make null pretty
@kevlarr
kevlarr / README.md
Last active October 9, 2017 17:53
Data transitions in D3 version 4

There is an excellent example of transitioning data in D3, but this only works in version 3.

D3 version 4 requires a slightly different approach, namely that the entered selections need to be merged prior to transition.

Added transition on exit. Also did a little code cleanup, especially given that eval is pretty gross.

@kevlarr
kevlarr / controllers.application.js
Created September 5, 2017 16:15
Testing relationships in tests
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@kevlarr
kevlarr / controllers.application.js
Last active May 12, 2017 13:04
Transitioning by model
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
@kevlarr
kevlarr / apartment.rb
Last active May 4, 2016 14:57
Ruby Mixins
class Apartment < Dwelling
include Holder
attr_accessor :rent
def initialize(address, rent, roommate_capacity)
super(address)
@rent = rent
set_capacity(roommate_capacity)
end