Skip to content

Instantly share code, notes, and snippets.

@gregneagle
gregneagle / prefs_observer.py
Created August 1, 2017 18:20
Getting notified when a preference changes (using PyObjC)
from Foundation import NSObject, NSUserDefaults, NSKeyValueObservingOptionNew
from Foundation import NSRunLoop, NSDate
class PrefsObserver(NSObject):
def observe(self, domain, key):
self.domain = domain
self.key = key
if self:
self.defaults = NSUserDefaults.alloc().initWithSuiteName_(
@ankurk91
ankurk91 / mac-apps.md
Last active October 8, 2024 06:45
Mac OS 10.15 Apps and configs

macOS Apps

⚠️ No longer maintained! ⚠️

# Install x-code command line tools 
xcode-select --install

# Install homebrew itself
@battis
battis / iTunesLibraryToggle
Last active August 21, 2018 13:09
Toggling between iTunes Libraries
#!/usr/bin/env bash
#
# usage: iTunesLibraryToggle [library] [playlist]
# e.g. iTunesLibraryToggle "$HOME/Music/iTunes (Music & Audiobooks)" Audiobooks
iTunesLibraryToggle() {
# make sure the iTunes directory is, in fact, a symlink
iTunesDir=$HOME/Music/iTunes
if [[ ! -d "$iTunesDir" || -L "$iTunesDir" ]] ; then
@ttscoff
ttscoff / karabiner.json
Created July 25, 2017 17:09
Example Karabiner Elements setup for Vim navigation keys using Hyper+h/j/k/l
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@mayel
mayel / up
Created July 20, 2017 14:50
up - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line
#!/bin/sh
# up - v2 - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line
# run thus to to install: cd /usr/local/bin && curl -s -O https://gist.githubusercontent.com/mayel/c07bc0acb91824501d5bdbdc9eb7b33a/raw/08821f64c067327ea68a1a817eb43657db10f10e/up && chmod 755 /usr/local/bin/up
# and then run it anytime by simply entering the command: up
# By https://github.com/mayel based on a script by https://github.com/imwally
# homebrew
# See http://pacha.hk/2017-07-15_gnu_nongnu_homebrew.html
# XCode CLT
xcode-select --install
# Update Homebrew and add formulae
brew update
# Check for broken dependencies and/or outdated packages
brew doctor
@tkrkt
tkrkt / github-add-subscribe-button.user.js
Last active November 1, 2020 22:29
[userscript] [GitHub] [Feedly] Add "Subscribe on Feedly" Button to release page
// ==UserScript==
// @name [GitHub] Add Subscribe on Feedly Button to release page
// @namespace https://gist.github.com/tkrkt
// @version 1
// @match https://github.com/*/*/releases
// @grant none
// ==/UserScript==
var container = document.querySelector('.repository-content .subnav .float-right');
if (container) {
@athityakumar
athityakumar / powerlevel9k.config
Created July 6, 2017 18:38
Powerlevel9k oh-my-zsh theme configuration for screenshots used in https://github.com/athityakumar/colorls
export ZSH=$HOME/.oh-my-zsh
export DEFAULT_USER='athityakumar'
TERM=xterm-256color
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='awesome-fontconfig'
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
POWERLEVEL9K_RPROMPT_ON_NEWLINE=true
POWERLEVEL9K_SHORTEN_DIR_LENGTH=2

On Learning

topics: {
      DEEP WORK:
        protect and cultivate (limited) attention,
        ear plugs,
        skeptical of music,
        examine your own process,
 downtime,
@zkat
zkat / index.js
Last active March 26, 2025 08:06
npx is cool
#!/usr/bin/env node
console.log('yay gist')