Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Marcus Shepherd marcusshepp

🎯
Focusing
View GitHub Profile
@marcusshepp
marcusshepp / vs-code.md
Created Mar 9, 2022
Visual Studio Code
View vs-code.md

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 => {
subject.next(bar);
});
this.connection.onclose((err?: Error): void => {
if (err) {
@marcusshepp
marcusshepp / visual-studio.md
Last active Feb 28, 2022
Visual Studio, kb shorts and good-to-knows
View visual-studio.md

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

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
View dotnet.md

dotnet reference

add a package

dotnet add package Microsoft.AspNet.SignalR

@marcusshepp
marcusshepp / docker.md
Last active Feb 15, 2022
Docker Cheatsheet
View docker.md

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
pop last commit from remote
View remote_pop.sh
# pop one commit from remote master
# '+' pushes with force
git push origin +HEAD^:master
@marcusshepp
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: ");
Console.WriteLine(foo);
changeFoo(ref foo);
@marcusshepp
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; }
}
View windowspowershell.md

powershell

Files and Directories

create a new file with new-item

new-item -name 'foobar.txt' -itemtype file -path . -value 'foobarpop'

create a new directory with new-item

new-item -name 'foobar' -itemtype directory -path .

moving items with move-item