Skip to content

Instantly share code, notes, and snippets.

@svenmuennich
svenmuennich / run.sh
Created October 10, 2018 22:54
Fix whitespace
#!/bin/bash
# Convert tabs to spaces (https://stackoverflow.com/a/11094620/981846)
find . \( -name '*.m' -o -name '*.h' -o -name '*.swift' -o -name '*.pch' \) ! -type d -exec bash -c 'expand -t 4 "$0" > /tmp/e && mv /tmp/e "$0"' {} \;
# Trim trailing whitespace (https://stackoverflow.com/a/10711226/981846)
find . \( -name '*.m' -o -name '*.h' -o -name '*.swift' -o -name '*.pch' \) ! -type d -exec bash -c 'sed "s/[[:space:]]\{1,\}$//" "$0" > /tmp/e && mv /tmp/e "$0"' {} \;

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@rjorgenson
rjorgenson / README.md
Last active June 2, 2020 14:42
Bear Journal

I created these scripts to generate some daily and monthly notes in Bear.

The launchd scripts will run the daily script every day at 3am and the monthly script on the first of every month at 2am. Make sure to update the path to the actual scripts in the launchd scripts before loading them.

mv com.bearjournal.daily.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.bearjournal.daily.plist

mv com.bearjournal.monthly.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.bearjournal.monthly.plist
Maintained version lives at https://github.com/retorquere/zotero-file-hierarchy
@erdincay
erdincay / sugh.sh
Last active March 28, 2025 16:44
su GitHub (downloading all repositories from a given user)
#!/bin/bash
if [ -z "$1" ]; then
echo "waiting for the following arguments: username + max-page-number"
exit 1
else
name=$1
fi
if [ -z "$2" ]; then
@renandf
renandf / keyboard-symbols.txt
Created August 29, 2018 23:39
List of keys and their symbols
⎋ Escape
⇥ Tab forward
⇤ Tab back
⇪ Capslock
⇧ Shift
⌃ Control
⌥ Option (Alt, Alternative)
⌘ Command
␣ Space
⏎ Return
# -*- sh -*-
#!/usr/bin/env bash
TMPFILE=/tmp/selfcontrol.temp
# remove self control from hosts
cat /etc/hosts | grep -v self-control > $TMPFILE
echo "# self-control" >> $TMPFILE
@haircut
haircut / tcc-reset.py
Last active December 17, 2024 16:38
Completely reset TCC services database in macOS
#!/usr/bin/python
"""
Completely reset TCC services database in macOS
Note: Both the system and individual users have TCC databases; run the script as both
a user and as root to completely reset TCC decisions at all levels.
2018-08-15: Resetting the 'Location' service fails; unknown cause
2018-08-16: Confirmed the 'All' service does not really reset _all_
services, so individual calls to each service is necessary.
@benjamineskola
benjamineskola / evening.applescript
Last active November 30, 2022 09:57
Automatically set repeating tasks tagged ‘Evening’ to be done this evening, in Things 3 — updated versions here: https://github.com/benjamineskola/things-scripts/blob/master/evening.applescript
-- run first thing in the morning, e.g., from cron
tell application "Things3"
set theToken to "your-auth-token"
set theTodos to to dos of list "Today"
repeat with aTodo in theTodos
set tagList to tags of aTodo
repeat with aTag in tagList
if (name of aTag as text) is "Evening"
@talkingmoose
talkingmoose / Add Past Completed Tasks to Bear Daily Notes.applescript
Last active February 24, 2019 13:56
Copies completed tasks in Things Logbook to Daily Note in Bear for a specified date. Useful after forgetting to copy tasks the day they were completed. Save this AppleScript to the Scripts folder for Bear at ~/Library/Scripts/Applications/Bear and call it using the system-wide AppleScript menu.
(*
----------------------------------------------------------------------------------
ABOUT THIS SCRIPT
Written by:William Smith
Professional Services Engineer
Jamf
[email protected]