Skip to content

Instantly share code, notes, and snippets.

@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
@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
@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
@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
@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
@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
@josefnpat
josefnpat / no-vim-ads.patch
Created January 10, 2015 20:38
Remove "ads" from vim
diff -r b3bc99b909c3 src/version.c
--- a/src/version.c Sat Jan 10 15:09:25 2015 +0100
+++ b/src/version.c Sat Jan 10 15:37:45 2015 -0500
@@ -2353,9 +2353,6 @@
#endif
N_("Vim is open source and freely distributable"),
"",
- N_("Help poor children in Uganda!"),
- N_("type :help iccf<Enter> for information "),
- "",
property defaultAccountName : "iCloud"
property defaultFolderName : "Saved iCloud Tabs"
global html
global processedURLs
on appendLineWithURLItem(urlItem)
my appendHTML(" <li>")
my appendHTML("<a href=\"" & |url| of urlItem & "\">")
my appendHTML(|Title| of urlItem)
@Sillium
Sillium / simplytel.js
Last active November 28, 2019 17:35
CasperJS script to check data usage of SimplyTel mobile phone contract
// Usage: casperjs simplytel.js <login> <password>
var casper = require('casper').create({
verbose: false,
logLevel: "info",
exitOnError: true
});
if (!casper.cli.has(0) || !casper.cli.has(1)) {
casper.echo("\nUsage: casperjs simplytel.js <login> <password>").exit();
@danhallock
danhallock / gist:dad31f851f171114f13b9db839f01aeb
Created October 31, 2017 21:51
Apple Photos keyword list
Abacus
Abacuses
Abalone
Abalones
Abode
Abodes
Accordion
Accordions
Accoutrement
Accoutrements