This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 22 com.apple.iWork.Keynote | |
| 18 com.apple.iWork.Pages | |
| 16 com.apple.iWork.Numbers | |
| 15 com.apple.iPhoto | |
| 13 com.microsoft.Powerpoint | |
| 9 com.microsoft.Excel | |
| 9 com.apple.logic.pro | |
| 9 com.adobe.Photoshop | |
| 8 com.microsoft.Outlook | |
| 7 com.microsoft.Word |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| let handle = dlopen("/System/Library/PrivateFrameworks/Calculate.framework/Calculate", RTLD_LAZY) | |
| let CalculatePerformExpression = unsafeBitCast(dlsym(handle, "CalculatePerformExpression"), to: | |
| (@convention(c) (UnsafePointer<CChar>, Int, Int, UnsafePointer<CChar>) -> Bool).self) | |
| let expression = Array(CommandLine.arguments.dropFirst()).joined(separator: " ") | |
| let answer = Array<CChar>(repeating: 0, count: 100) | |
| if CalculatePerformExpression(expression, 16, 1, answer) { | |
| print(String(cString: answer)) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Dynamic library that pauses a short lived program during launch so that a | |
| // debugger can attach to it. To use it, compile it on macOS: | |
| // clang -dynamiclib pause4debug.c -o pause4debug.dylib | |
| // On Linux: | |
| // gcc -shared -fPIC pause4debug.c -o pause4debug.so | |
| // To use it, make the dynamic linker inject it using DYLD_INSERT_LIBRARIES or | |
| // LD_PRELOAD, depending on your platform. On macOS: | |
| // DYLD_INSERT_LIBRARIES=/path/to/pause4debug.dylib debugme | |
| // On Linux, | |
| // LD_PRELOAD=/path/to/pause4debug.so debugme |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd() { | |
| # Set the current directory to the 0th history item | |
| cd_history[0]=$PWD | |
| if [[ $1 == -h ]]; then | |
| for i in ${!cd_history[@]}; do | |
| echo $i: "${cd_history[$i]}" | |
| done | |
| return | |
| elif [[ $1 =~ ^-[0-9]+ ]]; then | |
| builtin cd "${cd_history[${1//-}]}" || # Remove the argument's dash |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| let arguments = CommandLine.arguments | |
| switch arguments.count { | |
| case 1: | |
| let moduleDict = CFPreferencesCopyAppValue("moduleDict" as CFString, "com.apple.screensaver" as CFString) | |
| print(moduleDict?["moduleName"] as! String) | |
| print(moduleDict?["path"] as! String) | |
| case 3: | |
| let moduleDict = (CFPreferencesCopyAppValue("moduleDict" as CFString, "com.apple.screensaver" as CFString) as? NSDictionary)?.mutableCopy() as? NSMutableDictionary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| protocol SockAddr { } | |
| extension sockaddr_in: SockAddr { } | |
| extension sockaddr_in6: SockAddr { } | |
| enum SocketAddress: CustomDebugStringConvertible { | |
| case ipv4(sockaddr_in) | |
| case ipv6(sockaddr_in6) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>DomainsWithAssociatedCredentials</key> | |
| <array> | |
| <array> | |
| <string>comcast.net</string> | |
| <string>xfinity.com</string> | |
| </array> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function postUpdatedxkcdIfNecessary() { | |
| var properties = PropertiesService.getUserProperties(); | |
| var latestComic = JSON.parse(UrlFetchApp.fetch("http://xkcd.com/info.0.json").getContentText()); | |
| if (latestComic["num"] > properties.getProperty("lastComic")) { | |
| var title = latestComic["title"]; | |
| var imageURL = latestComic["img"]; | |
| var altText = latestComic["alt"]; | |
| var number = latestComic["num"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| if [ $# == 1 ]; then | |
| git fetch origin pull/$1/head:pr-$1 | |
| git checkout pr-$1 | |
| elif [ $# == 2 ]; then | |
| git fetch $1 pull/$2/head:pr-$2 | |
| git checkout pr-$2 | |
| else | |
| echo "Usage: git test-pr [remote] pr#" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/local/bin/bash | |
| # Make sure this runs on a modern bash with support for ;;& in case | |
| shopt -s extglob | |
| # Make sure we're in a git directory | |
| if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then | |
| # Print a leading space to separate from the rest of the PS1 | |
| echo -n " " | |
| # Check our status relative to upstream |