- A bullet point
- And another
This file contains hidden or 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
function Remove-StoppedContainers { | |
docker container rm $(docker container ls -q) | |
} | |
function Remove-AllContainers { | |
docker container rm -f $(docker container ls -aq) | |
} | |
function Get-ContainerIPAddress { | |
param ( |
This file contains hidden or 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
#!/bin/sh | |
xrandr --output HDMI-1 --same-as eDP-1 --auto --output eDP-1 --mode 1280x720 |
This file contains hidden or 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
# Description: Boxstarter Script | |
# Author: Alec Clews <[email protected]> (forked from Jess Frazelle <[email protected]>) | |
# Last Updated: 2018-01-10 | |
# | |
# Install boxstarter: | |
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force | |
# | |
# You might need to set: Set-ExecutionPolicy RemoteSigned | |
# | |
# Run this boxstarter by calling the following from an **elevated** command-prompt: |
Note: Information adapted from https://unix.stackexchange.com/questions/280532/m4-macro-implementation-of-global-non-volatile-counter
Markdown does not support auto numbering of sections :-(. However with some M4 magic and some minor changes to your markdown text you can add this handy feature.
The techinique uses the M4 macro processor maintain an auto incrmenting counter and add the correct section numbers to your markdown text.
This file contains hidden or 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
#!/usr/bin/env bash | |
docker container rm -f writer reader | |
docker volume rm testdata | |
docker container run --mount source=testdata,target=/tmp/data --name=writer -d alpine /bin/sh -c 'while echo $(( m += 1 )) >> /tmp/data/1 ; do sleep 5 ; done' | |
docker container inspect --format '{{.Mounts}'} writer | |
docker container run --volumes-from writer --name=reader -d alpine /bin/sh -c 'while true ; do sleep 600 ; done' | |
docker container inspect --format '{{.Mounts}'} reader | |
docker container exec -it reader tail -f /tmp/data/1 |
This file contains hidden or 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
#!/usr/bin/env python3 | |
def collatz(n: int, p = True): | |
i: int = 0 | |
while n > 1: | |
if n % 2 != 0: | |
n = 3*n +1 | |
i += 1 | |
if p: print(f"{i}: {n}") |
This file contains hidden or 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
# Install GVM following instructions at https://github.com/moovweb/gvm | |
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer) | |
if [[ ! -s "$HOME/.gvm/scripts/gvm" ]] ; then | |
Go Version Manager is not installed -- please see https://github.com/moovweb/gvm | |
exit 1 | |
fi | |
This file contains hidden or 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
#!/usr/bin/env bash | |
# Install a Vim package using Vim 8 package directory | |
# Specify package URL on command line as $1 | |
# See also https://shapeshed.com/vim-packages/ | |
# NB If installing Vim via Homebrew in MacOS, then use `brew install macvim`, do not use cask | |
REPO=${1:?Must provide package repo uri} |
This file contains hidden or 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
// Solve sudoku puzzles | |
package main | |
import ( | |
"fmt" | |
) | |
type SudokuBoard []int | |
func (b SudokuBoard) String() string { // For printing |