Skip to content

Instantly share code, notes, and snippets.

@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active April 16, 2025 20:12
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@vchirikov
vchirikov / fusion.bat
Last active August 23, 2019 10:01
CLR Fusion log collection
@echo off
SET PERFVIEW=C:\tools\PerfView64.exe
SET FUSLOGPATH=%~dp0
echo Press enter when ready to start collection...
pause
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v EnableLog /t REG_DWORD /d 1
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v LogFailures /t REG_DWORD /d 1
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v LogResourceBinds /t REG_DWORD /d 0
reg add HKLM\Software\Microsoft\Fusion /reg:64 /f /v LogPath /t REG_SZ /d %FUSLOGPATH%
<Target Name="CopyPdbToPackage" Inputs="@(ReferenceCopyLocalPaths->WithMetadataValue('ReferenceSourceTarget', 'ProjectReference'))" Outputs="%(ProjectReference.Identity)"
AfterTargets="CopyProjectReferencesToPackage">
<PropertyGroup>
<CurrentReference>%(ProjectReference.Identity)</CurrentReference>
<CurrentReferenceName>$([System.IO.Path]::GetFileNameWithoutExtension($(CurrentReference)))</CurrentReferenceName>
</PropertyGroup>
<Message Text="Copying PDB of $(CurrentReferenceName) to packages..." Importance="high" Condition="'%(ProjectReference.NugetIgnore)'!='true'"/>
<ItemGroup>
@natemcmaster
natemcmaster / README.md
Last active April 2, 2024 18:27
runtimeconfig.json schema

This defines the schema for .NET Core's runtimeconfig.json file.

Usage in an editor

Using Visual Studio, you can get auto-completion if you import the schema in your .JSON file like this:

{
  "$schema": "https://gist.githubusercontent.com/natemcmaster/0bdee16450f8ec1823f2c11af880ceeb/raw/runtimeconfig.template.schema.json"
}
@lenkan
lenkan / use-location.js
Created March 2, 2019 18:26
React hook that keeps up to date with the current location.
// @ts-check
import { useState, useEffect } from 'react'
function getCurrentLocation () {
return {
pathname: window.location.pathname,
search: window.location.search
}
}
@danmoseley
danmoseley / errors.md
Last active January 11, 2024 08:22
Windows/Unix file IO errors
Unix code(s)
@SQL-MisterMagoo
SQL-MisterMagoo / index.html
Last active March 19, 2020 19:30
Monitor Blazor WASM loading and report errors
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width" />
<title>Blazor Loading</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
</head>
@bradwilson
bradwilson / settings.json
Last active September 27, 2024 18:25
Ubuntu color scheme for Windows Terminal
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": "copy",
"keys": "ctrl+shift+c"
},
{
"command": "paste",
@pngwn
pngwn / ssg.md
Last active June 20, 2025 06:22
A Simple Svelte SSG.

The Simplest Svelte Static Site Generator

Assuming you don't want to statically export a Sapper app, most of the parts to build a simple SSG for Svelte already exist. The only thing that is missing is the tooling ('only').

However, you don't need a lot to get things going: just a couple of rollup builds and a config file will get you most of the way there. Just some glue.

What follows is a bunch of rambling, half thought out thoughts on how I would probably go about this. Most of the stuff discussed here is stuff I've actually done or half done or am in the process of doing with varying degrees of success. It is something I'll be spending more time on in the future. There are other things I have done, want to do, or think would be a good idea that are not listed here as they don't fall into the scope of a simple SSG.

*Dislaimer: This is how I would build an SSG, this isn't the only way, but I like this approach as there are a bunch of compile-time optimisations you can per

@3v1n0
3v1n0 / vscode-keybindings-alt+hjkl-zation.py
Last active December 9, 2020 09:22
Make VSCode default key-bindings more HJLK friendly using Alt to alternate to them
#/usr/bin/python3
import json
import sys
import os
import re
import copy
input = sys.argv[1]