Skip to content

Instantly share code, notes, and snippets.

using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Microsoft.EntityFrameworkCore;
using Newtonsoft.Json;
using Database;
using System.Security.Claims;
@jhoerr
jhoerr / chessie.fs
Last active December 11, 2018 23:26
An approach to tying together sync/async Chessie operations.
open Chessie.ErrorHandling
// A 'normal' synchronous function
let f a =
ok a
// A 'normal' async expression
let fAsync a = async {
return ok a
}
import * as redis from "redis";
import * as util from "util";
describe("Redis cache", () => {
const port = 6379;
const host = "iubot-test.redis-test.uits.iu.edu";
const token = "...TOKEN...";
const client = redis.createClient({
host: host,
port: port,
@jhoerr
jhoerr / jwt.ipynb
Last active May 30, 2017 21:15
JWT file access across enterprises
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
*EH1004.3*
Reprinted
March 28, 2017
ENGROSSED
HOUSE BILL No. 1004
_____
DIGEST OF HB 1004 (Updated March 27, 2017 3:18 pm - DI 129)
Citations Affected: IC 12-7; IC 12-17.2; IC 20-19; noncode.
*HB1004.2*
Reprinted
February 7, 2017
HOUSE BILL No. 1004
_____
DIGEST OF HB 1004 (Updated February 6, 2017 7:02 pm - DI 110)
Citations Affected: IC 12-7; IC 12-17.2; IC 20-51.
Synopsis: Prekindergarten education. Allows the division of family
resources (division) to award an early education matching grant to an
@jhoerr
jhoerr / ptp-survey-2017.txt
Last active May 2, 2017 14:23
Ping the People 2017 Survey
I use Ping the People primarily in the role of a/an (check all that apply)
[] private citizen
[] member of an issue-focused organization
[] lobbyist
[] non-profit employee
[] government employee
[] other [ Text field ]
Choose the statement that best reflects your interest in Indiana legislation:
() I am interested in a small number of specific bills

Description

Motivation and Context

How Has This Been Tested?

from boxsdk import JWTAuth
from boxsdk import Client
# automation id => 32828.... What to do with this?
auth = JWTAuth(
client_id='8grfp2...',
client_secret='1FwTmL...',
enterprise_id='322105',
jwt_key_id='qasd...',
rsa_private_key_file_sys_path='c:\\temp\\private_key_nopass.pem'
@jhoerr
jhoerr / MockDbContext.cs
Last active March 3, 2024 04:32
A mock DbContext for NSubstitute
// Caveats: does not support async enumerations, i.e. ToListAsync, ToArrayAsync
public class MockDbContext<T>
where T : Entity
{
public static ApplicationDbContext Create() => Create(new List<T>());
public static ApplicationDbContext Create(List<T> entities)
{
var queryable = entities.AsQueryable();