Skip to content

Instantly share code, notes, and snippets.

View dbowling's full-sized avatar
🌱
Always learning.

Dan Bowling dbowling

🌱
Always learning.
View GitHub Profile

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@sarsamurmu
sarsamurmu / index.html
Created November 5, 2020 10:00
Lit CSS Plugin Snippet for Reboost JS
<html>
<head>
<script type="module" src="./build.js"></script>
</head>
<body>
<my-element></my-element>
</body>
</html>
const FONT_FACES = `@font-face {
font-display: auto;
font-family: "Elections-Publico";
font-style: normal;
font-weight: 800;
src: url("https://some-url.com/fonts/Publico-Bold.woff") format("woff");
}
@font-face {
font-display: auto;
font-family: "Elections-Akkurat-Mono";
@schneefisch
schneefisch / restart_pods.md
Last active July 9, 2024 15:46
How to restart all pods in a statefulset or deployment

Various ways to restart pods

Restart deployment

The most gracefull way is to trigger a restart for the deployment. In this case, a pod will only be terminated once the new pod is ready. It will slowly replace all pods one after the other.

kubectl rollout restart deployment <deployment-name>

Restart pods in a statefulset

@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active July 22, 2024 22:01
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@StevenACoffman
StevenACoffman / GPG_and_GIT.md
Last active March 9, 2024 22:10 — forked from JamesOBenson/Generating a secure SSH Key and commands
SSH Generation and commands for GIT and GPG

GPG and GIT and SSH ... OH MY!

ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C gears@umich.edu -N ''
  • Then you won't be prompted for a passphrase. However, if you did have a passphrase:
ssh-keygen -o -a 100 -t ed25519 -f ~/.ssh/id_ed25519 -C gears@umich.edu -N 'Really do not use this passphrase'
  • Then you will be prompted to type your passphrase every time you interact with git remote (pull, push, fetch, etc.) This is intolerable.
@sagarjethi
sagarjethi / delete commits from a branch in git
Last active July 27, 2022 15:49
Delete commits from a branch in Git
#### Delete the last commit
For example your last commit
git push origin +aa61ab32^:master
Now you want to delete this commit then an Easy way to do this following
Steps
First reset the branch to the parent of the current commit
@AriaFallah
AriaFallah / sec.sh
Last active November 5, 2023 02:59
MacOS security CLI wrapper
#!/usr/bin/env bash
KEYCHAIN="secrets.keychain"
main () {
if [[ -z "$1" ]]; then
print_usage
fi
case "$1" in
@turtlemonvh
turtlemonvh / Makefile
Last active January 23, 2024 03:33
Golang Project Makefile Template
# Borrowed from:
# https://github.com/silven/go-example/blob/master/Makefile
# https://vic.demuzere.be/articles/golang-makefile-crosscompile/
BINARY = superdo
VET_REPORT = vet.report
TEST_REPORT = tests.xml
GOARCH = amd64
VERSION?=?
var assert = require("chai").assert;
var TennisGame = require("../src/TennisGame");
describe('Tennis Score', function() {
var tests = [
[0, 0, "Love-All"],
[1, 1, "Fifteen-All"],
[2, 2, "Thirty-All"],