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 / gunicorn.sh
Last active November 1, 2023 07:53
Django Gunicorn Daemon Script
# django gunicorn script
# Generates a Daemon process with Gunicorn.
# see processes with ps -aux
# tested on: Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-74-generic x86_64), aws ec2
# Runs on apps built with Django==1.9
# Marcus Shepherd <marcusshepdotcom@gmail.com>
# 3-12-16
NAME=project # REPLACE WITH BASE DIR NAME
@marcusshepp
marcusshepp / kill_port.sh
Created February 26, 2016 16:23
how to kill a port on mac os x terminal
lsof -i tcp:8000 # or what ever port # you need to search for
kill -9 <PID> # replace <PID> with the process PID you want to kill
@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 / windowspowershell.md
Last active February 17, 2022 15:17
Windows Powershell

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

@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>