Skip to content

Instantly share code, notes, and snippets.

View marcusshepp's full-sized avatar
🎯
Focusing

Marcus Shepherd marcusshepp

🎯
Focusing
View GitHub Profile
@marcusshepp
marcusshepp / profile.md
Last active November 15, 2022 16:19
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
marcusshepp / vs-code.md
Created March 9, 2022 16:09
Visual Studio Code

Collapse all

ctrl + k, ctrl + 0

@marcusshepp
marcusshepp / signal-r-observable.js
Created March 3, 2022 01:57
SignalR Observable
public foo(): Observable<any> {
if (this.connection) {
const subject: Subject<any> = new Subject<any>();
this.connection.on('', (bar): void => {
subject.next(bar);
});
this.connection.onclose((err?: Error): void => {
if (err) {
@marcusshepp
marcusshepp / visual-studio.md
Last active February 28, 2022 16:11
Visual Studio, kb shorts and good-to-knows

Visual Studio

Keyboard shorts

Collapsing

Toggle all collapsable content on current page

ctrl + m, ctrl + l

Collapse current code under cursor

ctrl + m, ctrl + m

@marcusshepp
marcusshepp / deletebranches.ps1
Created February 17, 2022 15:32
delete branches
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
@marcusshepp
marcusshepp / dotnet.md
Created February 16, 2022 23:50
dotnet

dotnet reference

add a package

dotnet add package Microsoft.AspNet.SignalR

@marcusshepp
marcusshepp / docker.md
Last active February 15, 2022 16:47
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
marcusshepp / remote_pop.sh
Created May 30, 2019 12:10
pop last commit from remote
# pop one commit from remote master
# '+' pushes with force
git push origin +HEAD^:master
@marcusshepp
marcusshepp / ref.cs
Created May 8, 2019 15:22
Passing a var by reference in C#
using System;
public class Program
{
public static void Main()
{
bool foo = false;
Console.WriteLine("foo 1: ");
Console.WriteLine(foo);
changeFoo(ref foo);
@marcusshepp
marcusshepp / mqu.css
Created March 15, 2019 16:27
media query for height and between two widths
@mixin mobile-only--height {
@media (max-height: 635px) and (min-width: 642px) and (max-width: 1440px) { @content; }
}