Skip to content

Instantly share code, notes, and snippets.

View mdekrey's full-sized avatar

Matt DeKrey mdekrey

View GitHub Profile
@mdekrey
mdekrey / pagination.tests.ts
Last active August 29, 2022 15:59
Pagination Logic
import { createPaginator } from './pagination';
describe('pagination', () => {
describe('defaults', () => {
const paginator = createPaginator();
describe('for 1 page', () => {
describe('at page 1', () => {
const pageNumber = 1,
pages = 1;
it('has expected boundaries', () => {
@mdekrey
mdekrey / protractor.scad
Last active February 24, 2020 14:26
Table Saw Mitre Angle Guide
$fn = 120;
$fnHole = 360;
inch = 25.4;
diskHeight = 8;
radius = 4.8 * inch;
maxDegrees = 30;
step = 1;
fenceThickness = 10;
fenceHeight = inch*2;
@mdekrey
mdekrey / profile-part.json
Created October 3, 2019 18:24
Windows Terminal Powershell Command Prompt
[
"The following object is the command line used for VS 2019 Professional to run Developer Powershell",
{
"commandline": "powershell.exe -NoExit -Command \"& {Import-Module 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\Tools\\Microsoft.VisualStudio.DevShell.dll'; Enter-VsDevShell -SetDefaultWindowTitle -InstallPath 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional' }\"",
"guid": "{26b30263-74e9-4146-b80e-11632e86d42c}",
"name": "VS2019 Dev Prompt"
}
]
@mdekrey
mdekrey / IUnitOfWork.cs
Created February 16, 2018 02:45
Unit of Work
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Woosti.Work
{
public interface IUnitOfWork : IDisposable
{
@mdekrey
mdekrey / setup.ps1
Created December 29, 2017 15:20
Machine Setup
# As always with machine setup, this is constantly evolving.
# As administrator, Powershell:
choco install -y `
7zip `
docker `
docker-compose `
docker-for-windows `
DotNet4.5.2 `
@mdekrey
mdekrey / docker-cheatsheet.ps1
Last active September 29, 2017 02:14
Docker Powershell Cheatsheet
# Remove all stopped containers
docker rm $(docker ps -a -q)
# Remove unnamed images
docker rmi $(docker images -f dangling=true -q)
# Remove ALL networks (this does not discriminate against built-in networks.)
docker network rm $(docker network ls -q)
using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc.Internal;
namespace Samples.Pages
{
// TODO - check to see if this is still needed by Kestrel
public class KestrelWorkaround