Skip to content

Instantly share code, notes, and snippets.

View stephensmitchell's full-sized avatar
🎯
Focusing

Stephen S. Mitchell stephensmitchell

🎯
Focusing
View GitHub Profile
@stephensmitchell
stephensmitchell / index.html
Created August 19, 2020 10:52
Material Design Lite components demo
<html>
<head>
<!-- Material Design Lite -->
<script src="https://code.getmdl.io/1.3.0/material.min.js"></script>
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.indigo-pink.min.css">
<!-- Material Design icon font -->
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
</head>
<body>
<table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
@stephensmitchell
stephensmitchell / ProjectSymbol.cs
Created August 17, 2020 13:03 — forked from KlausLoeffelmann/ProjectSymbol.cs
Demo for SkiaSharp based Custom Control in Xamarin.Forms
using SkiaSharp;
using SkiaSharp.Views.Forms;
using System;
using System.Runtime.CompilerServices;
using Xamarin.Forms;
namespace Legatro.Cross.Controls
{
class ProjectSymbol : SKCanvasView
{
@stephensmitchell
stephensmitchell / check_github_repo_size
Created August 14, 2020 07:14 — forked from dingzeyuli/check_github_repo_size
Check the size of a github repo before downloading
# http://webapps.stackexchange.com/questions/39587/view-estimated-size-of-github-repository-before-cloning
# tested on macOS
echo https://github.com/torvalds/linux.git | perl -ne 'print $1 if m!([^/]+/[^/]+?)(?:\.git)?$!' | xargs -I{} curl -s -k https://api.github.com/repos/'{}' | grep size
# output:
# "size": 1746294,
@stephensmitchell
stephensmitchell / blazor-state-user-docs.md
Created August 13, 2020 11:23 — forked from SteveSandersonMS/blazor-state-user-docs.md
Preserving State in Server-Side Blazor applications

Preserving State in Server-Side Blazor applications

Server-side Blazor is a stateful application framework. Most of the time, your users will maintain an ongoing connection to the server, and their state will be held in the server's memory in what's known as a "circuit". Examples of state held for a user's circuit include:

  • The UI being rendered (i.e., the hierarchy of component instances and their most recent render output)
  • The values of any fields and properties in component instances
  • Data held in DI service instances that are scoped to the circuit

Occasionally, users may experience a temporary network connection loss, after which Blazor will attempt to reconnect them to their original circuit so they can continue.

@stephensmitchell
stephensmitchell / github.css
Created August 8, 2020 01:37 — forked from theconektd/github.css
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
@stephensmitchell
stephensmitchell / blazor-auth.md
Created August 2, 2020 08:47 — forked from SteveSandersonMS/blazor-auth.md
Blazor authentication and authorization

Authentication and Authorization

Authentication means determining who a particular user is. Authorization means applying rules about what they can do. Blazor contains features for handling both aspects of this.

It worth remembering how the overall goals differ between server-side Blazor and client-side Blazor:

  • Server-side Blazor applications run on the server. As such, correctly-implemented authorization checks are both how you determine which UI options to show (e.g., which menu entries are available to a certain user) and where you actually enforce access rules.
  • Client-side Blazor applications run on the client. As such, authorization is only used as a way of determining what UI options to show (e.g., which menu entries). The actual enforcement of authorization rules must be implemented on whatever backend server your application operates on, since any client-side checks can be modified or bypassed.

Authentication-enabled templates for Server-Side Blazor

@stephensmitchell
stephensmitchell / Test-DNSName.ps1
Created July 18, 2020 13:59 — forked from JustinGrote/Test-DNSName.ps1
High Performance DNS Resolver in Powershell
using namespace System.Net
using namespace System.Threading.Tasks
using namespace System.Management.Automation
using namespace System.Collections.Generic
function Test-DNSName ([String[]]$hostnames, [int]$Timeout = 3000) {
<#
.SYNOPSIS
Given a list of DNS names, returns the ones that actually resolve to an actual name
#>
@stephensmitchell
stephensmitchell / newproject
Created July 18, 2020 11:40 — forked from drdrang/newproject
Script to create database entries, folders in iCloud, a folder in Mail, and a set of labels for a new project.
#!/usr/bin/python
import sqlite3
import os
import sys
from applescript import asrun
from subprocess import Popen, PIPE
import shutil
import requests
import json
@stephensmitchell
stephensmitchell / setupDevEnv_workaroundWSL2vhdxLimit.md
Created July 11, 2020 22:09 — forked from datocrats-org/setupDevEnv_workaroundWSL2vhdxLimit.md
Backup and restore WSL2 vhdx, avoid 256GB vhdx limit for docker desktop WSL2 native

Determine the expected size of the docker-desktop-data volume

  • Get the base image size + additional + all docker volumes using docker system df
  • Add raw uncompressed size for alpine (50MB), docker for your version of windows (700MB) and linux (80MB)

docker system df

Get info for the docker-desktop-data VHD

PS C:\Users\windows-admin\AppData\Local\Docker\wsl\data> Get-VHD -Path C:\Users\windows-admin\AppData\Local\Docker\wsl\data\ext4.vhdx
@stephensmitchell
stephensmitchell / Reports
Created July 11, 2020 01:21
Report-Generation.md
## stephensmitchell-forks Report Generation