Skip to content

Instantly share code, notes, and snippets.

View zanshin's full-sized avatar
💭
Making mistakes so you don't have to since 1961.

Mark Nichols zanshin

💭
Making mistakes so you don't have to since 1961.
View GitHub Profile
@zanshin
zanshin / check_service.sh
Created February 12, 2025 13:39
Check to see if a service is running, if not, start the service
#!/bin/bash
# Check if a service name was provided
if [ -z "$1" ]; then
echo "Usage: $0 <service_name>"
exit 1
fi
SERVICE_NAME="$1"

aspe:keyoxide.org:LEVANNWPGSGLE5R4J7ZH3GENYE

@zanshin
zanshin / Cargo.toml
Created June 28, 2024 13:36
Using enums and traits to mimic inheritance in Rust
[package]
name = "inheritance"
version = "0.1.0"
edition = "2021"
[dependencies]
strum = { version = "0.26.3", features = ["derive"] }
@zanshin
zanshin / Makefile
Created October 26, 2023 02:00 — forked from alexedwards/Makefile
Boilerplate Makefile for Go projects
# Change these variables as necessary.
MAIN_PACKAGE_PATH := ./cmd/example
BINARY_NAME := example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
@zanshin
zanshin / find-all-electron-versions.sh
Created September 29, 2023 04:04 — forked from april/find-all-electron-versions.sh
find all apps using Electron and their versions, on macOS systems
#!/usr/bin/env zsh
# patched versions for CVE-2023-4863: 22.3.24, 24.8.3, 25.8.1, 26.2.1
mdfind "kind:app" 2>/dev/null | sort -u | while read app;
do
filename="$app/Contents/Frameworks/Electron Framework.framework/Electron Framework"
if [[ -f $filename ]]; then
echo "App Name: $(basename ${app})"
electronVersion=$(strings "$filename" | grep "Chrome/" | grep -i Electron | grep -v '%s' | sort -u | cut -f 3 -d '/')
javascript:(() => {
const requestURL = "https://zanshin.github.io/save";
const token = "dfgkjlhsdfgkljghklhj";
const pageTitle = document.title;
const pageURL = window.location.href;
let metaImage = "";
let metaDescription = "";
function getMetaValue(propName) {
@zanshin
zanshin / jtoh.sh
Created September 25, 2020 14:26
Bash script to aid in converting Jekyll posts to Hugo posts
! /bin/bash
set -e
set -o pipefail
# header-cleanup.sh
#
# Read files with Jekyll style YAML headers and "clean them" so that Hugo
# conversion works.
#
# Problems:
@zanshin
zanshin / i3 config
Created April 24, 2018 17:27
i3-gaps and Polybar configurations
# i3 config file (v4)
#
# Please see https://i3wm.org/docs/userguide.html for a complete reference!
# Some colors
# Argonaut colors
# Black / Bright Black
set $color0 #232323
set $color8 #444444
@zanshin
zanshin / .nvim_background
Last active March 29, 2018 02:39
Base16 color switcher for Neovim
if !exists('g:colors_name') || g:colors_name != 'base16-chalk'
colorscheme base16-chalk
endif
@zanshin
zanshin / .nvim_background
Created March 28, 2018 23:11
.nvim_background
if !exists('g:colors_name') || g:colors_name != 'base16-solarized-dark'
colorscheme base16-solarized-dark
endif