Skip to content

Instantly share code, notes, and snippets.

@haircut
haircut / Quit-All-Apps-With-Whitelist.sh
Created February 8, 2017 15:16
Closes all running apps, excluding those found in a customizable whitelist
#!/bin/sh
# Quit apps command
read -r -d '' OSASCRIPT_COMMAND <<EOD
set white_list to {"Finder"}
tell application "Finder"
set process_list to the name of every process whose visible is true
end tell
repeat with i from 1 to (number of items in process_list)
set this_process to item i of the process_list
@pdxmph
pdxmph / fix_pinboard_titles.rb
Last active June 4, 2018 23:56
Fix Pinboard bookmarks with URLs for titles
#!/usr/bin/env ruby
require 'pinboard'
require 'nokogiri'
require 'open-uri'
# get your Pinboard API token here: https://pinboard.in/settings/password
pinboard = Pinboard::Client.new(:token => 'XXXXXXXXXXXXXX')
posts = pinboard.posts(:results => 50)
@melangue
melangue / copyURLplusTextSafari.scpt
Created February 5, 2017 09:28
Easily copy your text selection + url, title from current tab in Safari and today's to clipboard. Useful for referencing.
-- Safari - this copies Title, URL, Date (current tab) and text which you highlighted to the clipboard
-- originally from here: https://discussions.apple.com/thread/4561056?tstart=0
-- modified to show tab's Title.
-- I recommend assigning it to a shortcut, ctrl + c for example.
-- V
tell application "Safari"
activate
set theURL to URL of front document
set theTitle to name of front document
@pansen
pansen / mac.sh
Created February 3, 2017 11:51
Disable bunch of #$!@ in Sierra
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
@christopheranderton
christopheranderton / macosx-contextmenu-automator-stripmetadata.md
Created February 2, 2017 13:45
Add a ”Strip Metdata” Service to your context menu (Right-Click Menu) in macOS/Mac OS X. This Service uses ExifTool and Tag (both via Homebrew) or xattr.

1. What you need

  • macOS/Mac OS X (tested only on El Capitan, but should work on Sierra and older versions)
  • Xcode Command Line Tools / Xcode
  • Homebrew (http://brew.sh/)
  • Tag (via Homebrew)
  • ExifTool (via Homebrew)

2. Installing Homebrew, Tag and ExifTool

@4np
4np / menuBarApplication.md
Last active March 9, 2017 22:15
OS X Menu Bar Application

How to quickly create a menu bar application

Add a status bar icon

Download this icon and drag it into your Assets.xcassets.

Add a status item

AppDelegate.swift

@sloanlance
sloanlance / disable_macOS_parental_controls.sh
Last active September 7, 2021 16:00
Disable Parental Controls and other services in macOS Sierra (OS X)
#!/bin/bash
# This is a draft but it works
# FIRST (I don't even know if it works but we'll assume yes)
# sudo launchctl list
# sudo launchctl disable system/netbiosd
# sudo launchctl disable system/parsecd
# sudo launchctl disable system/parentalcontrols.check
# sudo launchctl disable system/airportd
@zmwangx
zmwangx / # macOS 10.12.2 default fonts.md
Last active December 21, 2019 09:21
macOS 10.12.2 default fonts

See script for details of each file.

Apple Support article Fonts included with macOS Sierra is also a good resource, but it is fairly confusing in certain ways, e.g. Songti SC is listed both under fonts that are "installed and enabled automatically by macOS Sierra" and that are "available for download in macOS Sierra" (Update. I checked macOS 10.12 and Songti SC has been there all along).

There is also a seemingly very informative article, Font Management in macOS and OS X by Kurt Lang, which I found via Google Search. This is where I found out about the new directory /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ ATS.framework/Versions/A/Resources/FontInfo in macOS Sierra which has replaced Stub Fonts in Font Book.app.

@4np
4np / SwiftyFrameworks.md
Last active December 24, 2018 18:58
Useful Frameworks, most of them developed in Swift

A list of Swifty Frameworks

Below you will find a list of interesting (primarily) Swift frameworks. This not at all a complete list, merely a list of frameworks I like and am thinking of using.

Alamofire

octicon An HTTP networking library written in Swift. Also see the Networking library mentioned below.

pod 'Alamofire', '~&gt; 4.0'
@snoby
snoby / OS X network optimize.txt
Last active February 21, 2025 02:06
OSX Sierra Network Performance Tweaks
#
# Reboot into recovery mode (cmd +r ) and in the terminal
#
nvram boot-args="serverperfmode=1 ncl=262144"
#reboot
#
# In regular mode