Skip to content

Instantly share code, notes, and snippets.

@LukePammant
LukePammant / .bash_aliases
Last active September 1, 2023 21:28
dotfiles
# To update just this file: curl -o ~/.bash_aliases https://gist.githubusercontent.com/LukePammant/bb867e2370aeff4579cbac827f9fd0f8/raw/.bash_aliases && source ~/.bash_aliases
alias ..='cd ../'
alias ....='cd ../../'
alias amend='git add . && git commit --amend --no-edit && git push -f'
alias reloadbashprofile='. ~/.bash_profile'
alias dnr='dotnet run'
alias dnrnp='dotnet run --no-launch-profile'
# Kubectl LOg regeX - quickly get the logs of container in a pod
# Examples - given a pod named `my-super-cool-long-named-pod-668d74bfcc-r46bw`
# - klox r46bw
# - klox r46bw daprd (if the pod has two containers and one named 'daprd'
klox() {
Pod=$(kubectl get pods -o name | grep -i $1)
kubectl logs $Pod $2
}
# Kubectl Describe regeX - quickly describe a pod
@LukePammant
LukePammant / auto-increment-npm
Last active March 28, 2023 16:21
Auto-increment NPM package in Azure Pipelines and publish to Azure Artifacts
trigger:
branches:
include:
- develop
- master
paths:
include:
- ./
resources:
@LukePammant
LukePammant / Mining.fsx
Created June 10, 2020 04:03
An attempt to learn F# & functional programming by building something for my game. This script should simple take a Miner and a Minable object and move resources from the Minable to the Minable while taking into account capacity on the Miner and availability on the Minable.
type ResourceType = Metal | Gas
type MinerId = MinerId of string
type MinerResource =
{ Type: ResourceType
Capacity: int
CurrentAmount: int
GatherRate: int }