Basically all cmdlets look like so: verb-noun
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
adog = log --all --decorate --oneline --graph | |
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all | |
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all | |
lg = !"git lg1" | |
st = status --short | |
b = branch -vv | |
[core] | |
editor = code --wait | |
autocrlf = input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const FS = require('fs'); | |
const OS = require('os'); | |
let EXEC_PATH = process.argv[1]; | |
let FILE_PATH = getFilePath(EXEC_PATH); | |
const FILE = JSON.parse(FS.readFileSync(FILE_PATH + '/myFile.json', 'utf8')); | |
function getFilePath(execPath){ | |
let splitter = (OS.type() === "Windows_NT") ? "\\" : "/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
let colorReset = "\x1b[0m"; //reset | |
let colorCode = (p) => { | |
if (p >= 100){ | |
return "\x1b[31m"; //red | |
} else if (p < 100 && p >= 90){ | |
return "\x1b[36m"; //cyan | |
} | |
return "\x1b[32m"; //green |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull mssql container | |
docker pull microsoft/mssql-server-linux | |
# run container, change password (strong enough) and port | |
docker run -d --name mssqlOnOSX -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=strongEnoughPassword123' -p 1433:1433 microsoft/mssql-server-linux | |
# see also: | |
# https://medium.com/@reverentgeek/sql-server-running-on-a-mac-3efafda48861 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"jest_test_boilerplate": { | |
"prefix": "test_jest", | |
"body": [ | |
"test(\"$1\", ($2) => {", | |
"\t$3", | |
"});" | |
], | |
"description": "basic boilerplate for a jest test case" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Version 3 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> | |
.INPUTS | |
<Inputs if any, otherwise state None> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Multistage build | |
FROM golang:alpine as build | |
## stage1: build app, make use of /go/src | |
RUN mkdir /go/src/app | |
WORKDIR /go/src/app | |
## copy sources to build-image | |
ADD ./src/main.go /go/src/app | |
RUN go build -o /bin/app |
-
Naming file with build restriction foo_${GOOS}.go
-
Adding build directives to the top of the file //+build linux,386 darwin windows
-
on build system set $GOOS variable to target system (no matter which OS is your build system linux<>windows) GOOS = windows go build main.go
-
cpu architecture can be set