A collection of reusable bash code.
- log: logging library
#!/bin/bash | |
pkgs=$(./list_purgable.py) | |
for pkg in $pkgs; do | |
echo "$(tput setaf 6)purging $pkg$(tput sgr0)" | |
sudo apt purge "$pkg" || sudo apt-mark manual "$pkg" | |
done |
// ==UserScript== | |
// @name Set C++ standard on cppreference.com | |
// @match https://en.cppreference.com/w/cpp/* | |
// @icon https://en.cppreference.com/favicon.ico | |
// ==/UserScript== | |
const DESIRED_CPP_STANDARD = "C++20"; | |
function changeCppStandard(elem) { | |
// find option labeled with DESIRED_CPP_STANDARD |
#! /usr/bin/env bash | |
set -e -u -o pipefail | |
# set options | |
COLLECTION_ID='317099' # Unsplash Editorial (aka Picture of the Day) | |
# set constants | |
IMG_RESOLUTION=$(xrandr --current | grep '\*' | awk '{print $1}' | sort | tail -n 1) | |
IMG_REMOTE_URI="https://source.unsplash.com/collection/${COLLECTION_ID}/${IMG_RESOLUTION}" |
A collection of reusable bash code.
To install, run (with updated URL):
curl -L 'https://gist.githubusercontent.com/jessestricker/d3db724a1554d19bffe4e6c6ecded54d/raw/5f8b1555ef222533857594a7f2629e4832cb92cf/install.sh' | sudo bash
package hexe | |
import ( | |
"math" | |
hsluv "github.com/hsluv/hsluv-go" | |
) | |
// Color defines an 8-bit packed color value in the HSLuv color space. | |
type Color uint8 |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[string] $Path, | |
[Parameter(Mandatory)] | |
[string] $Hash, | |
[ValidateSet("SHA1", "SHA256", "SHA512")] | |
[string] $Algorithm = "SHA256" |
function Test-FileHash { | |
[CmdletBinding()] | |
param ( | |
[Parameter(Mandatory)] | |
[string] $Path, | |
[Parameter(Mandatory)] | |
[string] $Hash, | |
[ValidateSet("SHA1", "SHA256", "SHA512")] |
Add the following lines to the .vmx
file, which describes the VM.
These settings were tested with VMware Workstation Player v17.
VMX Reference (slightly outdated)
from builtins import int, tuple, max | |
Result = tuple[int, int] | |
def points(game: Result, bet: Result) -> int: | |
""" | |
Calculates the awarded points for a given game result and bet. | |
- If the bet is exactly the same as the game result, 10 points are awarded. |