Skip to content

Instantly share code, notes, and snippets.

View KyleMit's full-sized avatar

Kyle Mitofsky KyleMit

View GitHub Profile
@KyleMit
KyleMit / Program.cs
Created March 5, 2023 16:58
Performance Benchmarks for Testing [a-Z]
View Program.cs
using System;
using System.Linq;
using System.Text.RegularExpressions;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs;
using BenchmarkDotNet.Running;
BenchmarkRunner.Run<TestAlphaCheck>();
View rebasing-a-branch-of-a-branch-after-squash-merging.md

Rebasing a branch of a branch after squash merging

Here's a question I asked on slack recently:

When we do a branch off a branch,
and then squash commit the original,
is there a way to get the original commits to not show up on the new PR?

It's a a scenario that comes up not infrequently...

@KyleMit
KyleMit / rename-main.md
Created February 18, 2022 21:44
Rename Default Branch to Main
View rename-main.md
@KyleMit
KyleMit / index.html
Last active June 9, 2021 03:38
Loading Spinner Demo
View index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loading Spinner Example</title>
<link rel="stylesheet" href="./style.css">
@KyleMit
KyleMit / index.html
Last active July 26, 2022 08:23
Walker's Algorithm
View index.html
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=Shift_JIS">
<title>Walkers</title>
</head>
<body>
<header>
@KyleMit
KyleMit / find-index.js
Created October 26, 2020 15:59
Twitter - Find Index
View find-index.js
let pets = [
{ name: "Ranger", type: "Dog" },
{ name: "Gill", type: "Cat" },
{ name: "Frida", type: "Cat" }
]
let startWithGIndex = pets.findIndex(el => el.name.startsWith("G"))
console.log(nameStartWithGIndex) // 1
@KyleMit
KyleMit / variadic-function.js
Created October 26, 2020 15:49
Twitter - Variadic Function
View variadic-function.js
let checkValInList = (val, ignoreCase, ...list) => {
return ignoreCase
? list.some(el => el.toLowerCase() === val.toLowerCase())
: list.includes(val)
}
checkValInList("hello", true, "Hi", "Hello", "Howdy") // true
checkValInList("hello", false, "Hi", "Hello", "Howdy") // false
@KyleMit
KyleMit / includes.js
Created October 26, 2020 15:34
Twitter - Includes
View includes.js
console.log(~"apple".indexOf("a")) // true
console.log("apple".indexOf("a") >= 0) // true
console.log("apple".includes("a")) // true
@KyleMit
KyleMit / autocomplete.html
Created October 26, 2020 14:45
Twitter - Autocomplete
View autocomplete.html
<div>
<label for="old-pass">Current Password:</label>
<input type="password" id="old-pass" autocomplete="current-password">
</div>
<div>
<label for="new-pass">Choose New Password:</label>
<input type="password" id="new-pass" autocomplete="new-password">
</div>
@KyleMit
KyleMit / barrel-up.js
Created October 26, 2020 13:40
Twitter - Barrel Up
View barrel-up.js
// index.ts
export { Dog } from 'dog/dog.component.ts';
export { Cat } from 'cat/cat.component.ts';
// module.ts
import { Cat, Dog } from 'index.ts';