Skip to content

Instantly share code, notes, and snippets.

View toddknutson's full-sized avatar

Todd Knutson toddknutson

View GitHub Profile
@splorp
splorp / DefaultCSS_Markdown.css
Last active August 21, 2024 12:25
A default stylesheet based on GitHub’s Markdown formatting for use with BBEdit’s Preview CSS feature.
body {
background-color: #FFF;
color: #333;
font: 15px Helvetica, arial, freesans, clean, sans-serif;
word-wrap: break-word;
line-height: 1.7;
padding: 0 20px 20px 20px;
width: 722px;
-webkit-font-smoothing: antialiased;
}
@Starefossen
Starefossen / tmux-cheats.md
Last active May 2, 2025 15:52
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
@davfre
davfre / bamfilter_oneliners.md
Last active January 18, 2025 22:47
SAM and BAM filtering oneliners
@niksumeiko
niksumeiko / git.migrate
Last active April 29, 2025 08:03
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@muffinresearch
muffinresearch / toggle-finder-hidden-files.sh
Created April 16, 2014 10:52
Shell Script Toggle hidden files OSX
#!/usr/bin/env bash
if [ "$(defaults read com.apple.finder AppleShowAllFiles)" == 'TRUE' ]; then
defaults write com.apple.finder AppleShowAllFiles FALSE
else
defaults write com.apple.finder AppleShowAllFiles TRUE
fi
killall Finder
exit 0
@johnfmorton
johnfmorton / TransmitOpenTerminal.txt
Last active February 16, 2025 05:13
Use Transmit 5 to open in iTerm (instead of Terminal.app) as mentioned here https://library.panic.com/transmit5/open-in-terminal/
on openTerminal(location, remoteHost, serverPort)
tell application "System Events"
-- some versions might identify as "iTerm2" instead of "iTerm"
set isRunning to (exists (processes where name is "iTerm")) or (exists (processes where name is "iTerm2"))
end tell
tell application "iTerm"
activate
set targetTab to ""
@karanlyons
karanlyons / log4shell_regexes.py
Last active March 7, 2022 03:49
log4shell Regexes
import re
from urllib.parse import unquote
FLAGS = re.IGNORECASE | re.DOTALL
ESC_DOLLAR = r'(?:\$|[\\%]u0024||\\x24|\\0?44|%24)'
ESC_LCURLY = r'(?:\{|[\\%]u007B|\\x7B|\\173|%7B)'
ESC_RCURLY = r'(?:\}|[\\%]u007D|\\x7D|\\175|%7D)'
_U_PERCENT_ESCAPE_RE = re.compile(r'%(u[0-9a-f]{4})', flags=FLAGS)
_PERCENT_ESCAPE_RE = re.compile(r'%[0-9a-f]{2}', flags=FLAGS)