Test-Path $Profile
New-Item –Path $Profile –Type File –Force
code $profile
# 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 |
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 |
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) { |
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 |