Skip to content

Instantly share code, notes, and snippets.

Kyle KyleMit

Block or report user

Report or block KyleMit

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
@KyleMit
KyleMit / GitPair.md
Last active Jun 13, 2019
Git Pair Alias
View GitPair.md

Git Pair Alias

Pair Programming is great - here's a way to make it greater with easy way to toggle on mutliple attribution for each a commit.

Add this alias to your global .gitconfig file (git config --global --edit)

[alias]
    pair = "!f() {                                                           \
                local name=$1;                                               \
View app_offline.htm
<!DOCTYPE html>
<html>
<head>
<title>VRIMS Offline | Vermont Department of Health</title>
<style type="text/css">
html {
background: #fffdef;
}
body {
display: flex;
@KyleMit
KyleMit / archive.ps1
Last active May 7, 2020
Execute Powershell Script on Right Click in Windows Explorer
View archive.ps1
$path = $args[0]
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show("Hello $path")
View navigate_sections.js
var chaperRegex = /(chapter)(\d{1,2})(-)(\d{1,2})/
function LoadNextSection() {
// build next section address
var nextSectionUrl = window.location.href.replace(chaperRegex,
function(match, first, chapter, second, section) {
var nextSection = +section+1 // increment
if (nextSection < 10) nextSection = "0" + nextSection; // pad with 0
return first + chapter + second + nextSection;
});
@KyleMit
KyleMit / Array without IndexOf.js
Last active Apr 6, 2019
String Characters - Group & Count
View Array without IndexOf.js
var myString = "aaAbbcdeffff".toUpperCase()
// potential bucket for one of every letter
var letters = [] // ex. ["a", "b", "c", "d"]
var counts = [] // ex. [3, 2, 1, 1]
// loop through every letter in string
for (i=0; i < myString.length; i++) {
var char = myString[i]
@KyleMit
KyleMit / SarcasmPerf.md
Last active Mar 29, 2019
sArCasM cAsInG
View SarcasmPerf.md

Here's the challenge

Produce a function which takes in some text and produces a string that alternates between upper and lower casing between every character

Step 2 - Eek out the best possible perf

Step 3 - Find an ice bucket, fill it with coffee, and drink it while you're coding

Before we lean too heavily on performance, two disclaimers:

View GitLog.md

Color Formatted:

$ git log --no-merges --shortstat --author="Kyle Mitofsky" --date=format:'%m/%d %I:%M %p' --pretty="@%C(yellow)%h %C(green)%cn %C(cyan)%cd %C(reset)- %<(50,trunc)%s"

One Line:

$ git log --no-merges --shortstat --author="Kyle Mitofsky" --date=format:'%m/%d %I:%M %p' --pretty="@%C(yellow)%h %C(green)%cn %C(cyan)%cd %C(reset)- %<(50,trunc)%s" | tr "\n" " "  |  tr "@" "\n" |  sed -r 's/ insertions?| deletions?|[0-9]* files? changed,//g'
@KyleMit
KyleMit / .bashrc
Created Jan 14, 2019
Custom Bash Prompt
View .bashrc
# PS1 special characters
UserName="\u" # the username of the current user
HostShort="\h" # the hostname up to the first `.'
WorkingDirectory="\w" # the current working directory
HostFull="\H" # the hostname
JobCount="\j" # the number of jobs currently managed by the shell
DeviceName="\l" # the basename of the shell's terminal device name
NewLine="\n" # newline
Return="\r" # carriage return
@KyleMit
KyleMit / cloudSettings
Last active May 8, 2020
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-05-08T18:28:40.596Z","extensionVersion":"v3.4.3"}
@KyleMit
KyleMit / CodeBlocks.md
Last active Dec 31, 2018
Code Blocks & Syntax Highlighting
View CodeBlocks.md
You can’t perform that action at this time.