Skip to content

Instantly share code, notes, and snippets.

:shipit:
Shipping

Nick Craver NickCraver

:shipit:
Shipping
Block or report user

Report or block NickCraver

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 dashboard-5c5ee7780849a005a92cb1a6.json
gi{"name":"Overview","desc":"System Overview","controller_version":"5.10.12","modules":[{"id":"default:mega|status","module_id":"mega|status","restrictions":{"removable":false,"draggable":false},"config":{}},{"module_id":"internet-connection","config":{},"id":"dd5f7461-f8f0-4017-859c-3d9271b673bf"},{"module_id":"summary|wifi","config":{},"id":"13a78652-ad84-4fcb-943a-86929c638353"},{"module_id":"clients|freq-distribution","config":{"palette":"BLUE_GRADIENT_10"},"id":"c9626f4f-021f-4d46-b22d-86007570bac7"},{"module_id":"clients|top5|active","config":{"trafficType":"total"},"id":"36a9e071-132e-4b4a-baee-250449a6d44f"},{"module_id":"devices|uap|top5|channel-util","config":{"trafficType":"total"},"id":"9803f077-b9cd-4db0-b466-60d92fae2020"},{"module_id":"devices|uap|top5|active","config":{"trafficType":"total"},"id":"e6133049-cc56-44b3-a4c2-b0843912dac5"},{"module_id":"devices|uap|top5|client-count","config":{},"id":"d39f9c80-1827-4ba0-b573-3209789c56b5"},{"module_id":"summary|switching","config":{},"id":"5966437
@NickCraver
NickCraver / TopCPUUsers.sql
Created Apr 24, 2019
SQL: Top CPU Users query
View TopCPUUsers.sql
SELECT AvgCPU, AvgDuration, AvgReads, AvgCPUPerMinute,
TotalCPU, TotalDuration, TotalReads,
PercentCPU, PercentDuration, PercentReads, PercentExecutions,
ExecutionCount,
ExecutionsPerMinute,
PlanCreationTime, LastExecutionTime,
SUBSTRING(st.text,
(StatementStartOffset / 2) + 1,
((CASE StatementEndOffset
WHEN -1 THEN DATALENGTH(st.text)
@NickCraver
NickCraver / Overview.json
Created Mar 12, 2019
Craver's UniFi dashboard layout
View Overview.json
{"name":"Overview","desc":"System Overview","controller_version":"5.10.12","modules":[{"id":"default:mega|status","module_id":"mega|status","restrictions":{"removable":false,"draggable":false},"config":{}},{"module_id":"summary|wifi","config":{},"id":"13a78652-ad84-4fcb-943a-86929c638353"},{"module_id":"clients|freq-distribution","config":{"palette":"BLUE_GRADIENT_10"},"id":"c9626f4f-021f-4d46-b22d-86007570bac7"},{"module_id":"clients|top5|active","config":{"trafficType":"total"},"id":"36a9e071-132e-4b4a-baee-250449a6d44f"},{"module_id":"devices|uap|top5|channel-util","config":{"trafficType":"total"},"id":"9803f077-b9cd-4db0-b466-60d92fae2020"},{"module_id":"devices|uap|top5|active","config":{"trafficType":"total"},"id":"e6133049-cc56-44b3-a4c2-b0843912dac5"},{"module_id":"devices|uap|top5|client-count","config":{},"id":"d39f9c80-1827-4ba0-b573-3209789c56b5"},{"module_id":"summary|switching","config":{},"id":"5966437b-54f7-43e6-9c03-2adbdeb3c0a6"},{"module_id":"devices|usw|top5|active","config":{},"id":"c83ac
@NickCraver
NickCraver / TweetDeckDark.css
Last active Nov 15, 2018
TweetDeck Dark Theme
View TweetDeckDark.css
@-moz-document domain("tweetdeck.twitter.com") {
html.dark {
color: #e1e8ed;
}
html.dark body:before {
background-image: radial-gradient(circle, #1c6399, #274256);
}
html.dark body,
html.dark .app-header,
html.dark .app-title,
@NickCraver
NickCraver / Program.cs
Created Oct 16, 2018
.NET Core Exceptions memory leak repro
View Program.cs
using System;
using System.Threading.Tasks;
namespace ConsoleApp2189
{
public static class Program
{
public static void Main(string[] args)
{
while (true)
@NickCraver
NickCraver / DarkMode.js
Last active Feb 14, 2019
A quick and dirty re-purpose of UniFi dark elements to make them global.
View DarkMode.js
// A JS example that shows they're well on their way to a dark theme:
document.body.classList.add("ubnt-mod-dark");
document.querySelectorAll(".appTable").forEach(i => i.classList.add("appTable--dark"));
document.querySelectorAll(".ubntPanelContent").forEach(i => i.classList.add("appForm--dark"));
document.querySelectorAll(".appMainButtonGroup").forEach(i => i.classList.add("appMainButtonGroup--dark"));
@NickCraver
NickCraver / OptInRelationalModelSource.cs
Last active Aug 22, 2018
OptInRelationalModelSource.cs - Making EF Core opt-in instead of opt-out for properties
View OptInRelationalModelSource.cs
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Reflection;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Infrastructure.Internal;
using Microsoft.EntityFrameworkCore.Metadata.Conventions;
using Microsoft.EntityFrameworkCore.Metadata.Conventions.Internal;
View keybase.md

Keybase proof

I hereby claim:

  • I am nickcraver on github.
  • I am nickcraver (https://keybase.io/nickcraver) on keybase.
  • I have a public key ASAVMojHFRx86OeapA0fAbGblg0VzqFn4agNkah58X9ixQo

To claim this, I am signing this object:

@NickCraver
NickCraver / DelayTest.cs
Created Jul 22, 2018
A simple program showing Task.Delay(1) and what really happens
View DelayTest.cs
async Task Main()
{
for (var i = 0; i < 20; i++)
{
await Run(); // Just to show it many times
}
}
public async Task Run()
{
@NickCraver
NickCraver / Craver-Paradox.ps1
Last active Mar 23, 2018
My PowerShell PoshGit theme (used with Cmder)
View Craver-Paradox.ps1
#requires -Version 2 -Modules posh-git
# This is a tweaked version of https://github.com/JanJoris/oh-my-posh/blob/master/Themes/Paradox.psm1
function Write-Theme {
param(
[bool]
$lastCommandFailed,
[string]
$with
)
You can’t perform that action at this time.