Skip to content

Instantly share code, notes, and snippets.

Drinking refreshing JWT tokens

Chris S. yetanotherchris

Drinking refreshing JWT tokens
Block or report user

Report or block yetanotherchris

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View cidr-cheatsheet.txt
Netmask Netmask (binary) CIDR Notes
_____________________________________________________________________________ 11111111.11111111.11111111.11111111 /32 Host (single addr) 11111111.11111111.11111111.11111110 /31 Unuseable 11111111.11111111.11111111.11111100 /30 2 useable 11111111.11111111.11111111.11111000 /29 6 useable 11111111.11111111.11111111.11110000 /28 14 useable 11111111.11111111.11111111.11100000 /27 30 useable 11111111.11111111.11111111.11000000 /26 62 useable 11111111.11111111.11111111.10000000 /25 126 useable
yetanotherchris / git-config.ps1
Created Apr 3, 2019
Set git to use a different email (per repository)
View git-config.ps1
git config --local ""
yetanotherchris /
Last active Jun 25, 2018
Notes on converting Roadkill wiki (MVC 3/4) to .net core (MVC 6)
  • RedirectToRouteResult is now RedirectToActionResult, with an ActionName property
  • No System.Runtime.Caching - replace it with IMemoryCache (Microsoft.Extensions.Caching.Memory)
  • typeof(x).Assembly is now typeof(x).GetTypeInfo().Assembly
  • MongoCollection has changed
  • StringComparison.InvariantCultureIgnoreCase is gone, easy replacement
  • Configuration + Sections are totally different
  • HttpContext and HttpRequest etc. now found in Microsoft.AspNetCore.Http.Abstractions - Microsoft.AspNetCore.Http.HttpRequest
  • Request.RequestUri is now various new properties, for example Request.Host (a HostString)
  • WebActivatorEx?
  • DependencyResolver?
yetanotherchris /
Last active Oct 4, 2016
Template for the Jekyll blog posts
Published title author layout shortpost tags
Title here
Chris S
yetanotherchris / install.ps1
Last active Nov 11, 2018
Setup script for a new PC/laptop, once all the bloatware has been removed
View install.ps1
# Launch Powershell as admin
Set-ExecutionPolicy RemoteSigned -Confirm:$false -Force
iex ((new-object net.webclient).DownloadString(''))
# Stop prompting in Choclately
choco feature enable -n allowGlobalConfirmation
choco install googlechrome
choco install firefox
choco install coneumu
View powershell-cheatsheet.ps1
# Using properties inside strings
$now = get-date
$shortId = "$($now.Millisecond)$($now.Day)$($now.Month)"
# Parameters, eg .\myscript.ps1 -arg1 value1 -arg2 value2 -force
param (
$arg1 = "defaultvalue",
[string] $arg2 = $(throw "-arg2 is required."),
yetanotherchris / git-cheatsheet.ps1
Last active Apr 2, 2018
Git blackbelt commands
View git-cheatsheet.ps1
# Change the config editor to notepad
git config --global core.editor notepad
# ...and then edit the config
git config --global --edit
# Revert master back by 5 commits
git revert --no-commit HEAD~5..
# Revert master back by 5, but do it so there you get a "Revert commit" for each commit you reverted (this opens Vim)
mziwisky /
Last active May 28, 2020
Oauth2 Explanation


The Problem

I’m a web app that wants to allow other web apps access to my users’ information, but I want to ensure that the user says it’s ok.

The Solution

I can’t trust the other web apps, so I must interact with my users directly. I’ll let them know that the other app is trying to get their info, and ask whether they want to grant that permission. Oauth defines a way to initiate that permission verification from the other app’s site so that the user experience is smooth. If the user grants permission, I issue an AuthToken to the other app which it can use to make requests for that user's info.

Note on encryption

Oauth2 has nothing to do with encryption -- it relies upon SSL to keep things (like the client app’s shared_secret) secure.

You can’t perform that action at this time.