Skip to content

Instantly share code, notes, and snippets.

@gbuesing
gbuesing / btclearcache.sh
Created September 20, 2014 03:39
Clear the Bluetooth attributes cache on Mac OS X
#!/bin/sh
# Clear the Bluetooth attributes cache on Mac OS X
# From http://expertsoverflow.com/questions/23549859/clearing-corebluetooth-gatt-cache-without-removing-bond
sudo defaults write /Library/Preferences/com.apple.Bluetooth CoreBluetoothCache -dict
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.blued.plist
sudo launchctl load /System/Library/LaunchDaemons/com.apple.blued.plist
@markcerqueira
markcerqueira / gist:9902072
Created March 31, 2014 20:57
CrashPlan and the Mac library folder
This file seeks to explain what should and should not be backed up from the Library folder on your Mac to minimize the amount of data sent over the wire to your backup server. Some files in the Library folder are important to backup whereas others are not critical.
There are two general strategies for handling the Library folder:
1. Start with nothing (de-select the Library folder) and selectively add files/folders
2. Start with everything and de-select files/folders we do not want to back up
Regardless of strategy, here are some things that you SHOULD back up and things you SHOULD NOT back up. Note, the exclusion list includes folders outside the Library folder that should also not be backed up.
GOOD TO BACK UP
@zqqf16
zqqf16 / get_scheme.sh
Last active November 5, 2018 10:35
Get the URL scheme from ipa file
#!/bin/bash
ipa_name=$1
plist_path=$(unzip -l "$ipa_name" | grep "Payload/[^/]*\/Info.plist" | sed 's/.*\(Payload.*Info.plist\)/\1/g')
#unzip
unzip -jo "$ipa_name" "$plist_path" >/dev/null
#convert to xml1 format
plutil -convert xml1 Info.plist
@Zettt
Zettt / TextExpander to Text Shortcuts.applescript
Last active December 3, 2024 10:59
TextExpander Snippet to iOS/OS X Text Shortcuts. Read more: http://tmblr.co/ZFavEy-uZJ-M
set clickDelay to 0.3
set abbreviationList to {}
set snippetsList to {}
set disallowedGroups to {"AutoCorrect", "AutoCorrect Deutsch Snippets", "AlteNeue Rechtschreibung", "Deutsche Akronyme"}
set disallowedSnippetContents to {"%e", "%d", "%a", "%A", "%m", "%1m", "%b", "%B", "%y", "%Y", "%H", "%I", "%1H", "%1I", "%M", "%1M", "%S", "%1S", "%p", "%@+", "%@-", "%key:", "%clipboard", "%|", "%<", "%^", "%>", "%v", "%-", "%+", "%fill:", "%fillpart:", "%filltext:", "%fillpopup:", "%fillarea:"}
-- open the Text tab of Keyboard preferences
tell application "System Preferences"
activate
delay 5
@benwaldie
benwaldie / 2013-02-15-TUAW_Waldie.applescript
Created February 16, 2013 04:53
TUAW > AppleScripting OmniFocus > Send Completed Task Report to Evernote
-- Prepare a name for the new note
set theNoteName to "OmniFocus Completed Task Report"
-- Prompt the user to choose a scope for the report
activate
set theReportScope to choose from list {"Today", "Yesterday", "This Week", "Last Week", "This Month"} default items {"Yesterday"} with prompt "Generate a report for:" with title "OmniFocus Completed Task Report"
if theReportScope = false then return
set theReportScope to item 1 of theReportScope
-- Calculate the task start and end dates, based on the specified scope
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 24, 2025 05:34
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx