Skip to content

Instantly share code, notes, and snippets.


Marcus Shepherd marcusshepp

View GitHub Profile
marcusshepp /
Last active Nov 15, 2022
powershell profile

Test if a profile file exists

Test-Path $Profile

Create a new profile file

New-Item –Path $Profile –Type File –Force

Open profile

code $profile

marcusshepp /
Created Mar 9, 2022
Visual Studio Code

Collapse all

ctrl + k, ctrl + 0

View signal-r-observable.js
public foo(): Observable<any> {
if (this.connection) {
const subject: Subject<any> = new Subject<any>();
this.connection.on('', (bar): void => {;
this.connection.onclose((err?: Error): void => {
if (err) {
marcusshepp /
Last active Feb 28, 2022
Visual Studio, kb shorts and good-to-knows

Visual Studio

Keyboard shorts


Toggle all collapsable content on current page

ctrl + m, ctrl + l

Collapse current code under cursor

ctrl + m, ctrl + m

View deletebranches.ps1
cd ~/projects/da/da_ui
$branches = (git branch) | Out-String
$branches = $branches.Split([Environment]::NewLine)
for ($num = 0; $num -lt $branches.Count; $num++) {
$branch = $branches[$num] -replace '\s',''
if (![string]::IsNullOrEmpty($branch) -and !($branch -match "Release_Candidate") -and !($branch -match "master")) {
$answer = read-host "delete this branch? ${branch}
${[Environment]::NewLine} y == delete locally

dotnet reference

add a package

dotnet add package Microsoft.AspNet.SignalR

marcusshepp /
Last active Feb 15, 2022
Docker Cheatsheet

Process Management

Show all running docker containers

docker ps

Show all docker containers

docker ps -a

Run a container

docker run <image>:<tag>

marcusshepp /
Created May 30, 2019
pop last commit from remote
# pop one commit from remote master
# '+' pushes with force
git push origin +HEAD^:master
marcusshepp / ref.cs
Created May 8, 2019
Passing a var by reference in C#
View ref.cs
using System;
public class Program
public static void Main()
bool foo = false;
Console.WriteLine("foo 1: ");
changeFoo(ref foo);
marcusshepp / mqu.css
Created Mar 15, 2019
media query for height and between two widths
View mqu.css
@mixin mobile-only--height {
@media (max-height: 635px) and (min-width: 642px) and (max-width: 1440px) { @content; }