Skip to content

Instantly share code, notes, and snippets.

View getawaywithrmdir's full-sized avatar

Getaway getawaywithrmdir

View GitHub Profile
@pudquick
pudquick / brew.md
Last active May 5, 2025 21:30
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@NerdyDeedsLLC
NerdyDeedsLLC / audiovol.sh
Last active June 7, 2024 02:28
BASH & ZSH Script that (using AppleScript) allows for the adjustment of speaker AND MICROPHONE volumes from CLI.
function vol(){ audiovol 'output' $1; }
function mic(){ audiovol 'input' $1; }
function audiovol(){
AUDIO_IO=$1
NEW_VOLUME=$2
[[ "$AUDIO_IO" == "" ]] && AUDIO_IO='input'
[[ "$AUDIO_IO" == "input" ]] && DEVICE_TEXT='Microphone' || DEVICE_TEXT='Speakers'
if [[ "$NEW_VOLUME" == "" ]]; then [ "$(osascript -e "$AUDIO_IO volume of (get volume settings)")" -gt 0 ] && NEW_VOLUME=0 || NEW_VOLUME=100; fi
[ $NEW_VOLUME -gt 0 ] && MUTE_TEXT='Unmuted' || MUTE_TEXT='Muted'
@amalmurali47
amalmurali47 / edit_commit_history.md
Last active October 28, 2025 19:07
Change ownership of selected older commits in Git
  1. Clone the repo.
  2. Use git rebase -i --root
  3. vim will open. Select the commits you want to modify by changing pick to edit. If you would like to change all the commits, perform the following replace: :%s/^pick/edit/g. This command changes all instances of "pick" at the start of lines to "edit".
  4. You will now be shown all the selected commits one by one. Each commit message will be displayed. You have two options:
    • If you would like to keep the commit author details the same, do a git rebase --continue.
    • If you would like to change it to a different name/email, do git commit --amend --reset-author. If --reset-author is specified, it will use the details from your git config. (If you need to specify an alternate name/email, you can do so with --author="John Doe <[email protected]>". If you would like to change the time to a previous date, you can do so with --date "2 days ago".)
  5. Do the same for all the commits and finish the rebase.
  6. Perform git push -f origin master to
@lopspower
lopspower / README.md
Last active November 1, 2025 12:14
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@mojavelinux
mojavelinux / marked-asciidoc-content.adoc
Last active June 12, 2025 06:01
Advice on configuring Marked (OSX) to work with AsciiDoc content using AsciiDoc (or Asciidoctor) as a custom Markdown processor, including how to get AsciiDoc includes to work.

Using Marked with AsciiDoc content

Using Marked with AsciiDoc content

Marked is an OSX application to preview Markdown syntax in HTML. It’s possible to configure AsciiDoc as an custom Markdown processor to create the HTML for your AsciiDoc files.