This file contains 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
tell application "Terminal" | |
set openWindows to every window | |
set openTabs to {} | |
repeat with i from 1 to number of items in openWindows | |
set this_item to item i of openWindows | |
set openTabs to openTabs & every tab of this_item | |
end repeat | |
repeat with i from 1 to number of items in openTabs | |
set this_item to item i of openTabs | |
do script "source ~/.zshrc" in this_item |
This file contains 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/bin/env/nush | |
(load "ScriptingBridge") ; Load the ScriptingBridge framework | |
(set finder (SBApplication applicationWithBundleIdentifier: "com.apple.Finder")) ; Reference to shared instance | |
(puts (((finder disks) 0) name)) ; Name of the first disk in the Finder |
This file contains 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/nush | |
(load "ScriptingBridge") ;; Access the Finder | |
(function path () | |
(((((SBApplication applicationWithBundleIdentifier:"com.apple.Finder") selection) get) objectAtIndex:0) URL)) | |
(function stripURL (path) | |
(path substringFromIndex:16)) | |
(system ("echo " stringByAppendingString:((stripURL (path)) stringByAppendingString:" | pbcopy"))) |
This file contains 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/nush | |
(function say (something *voice) | |
(if (*voice) | |
(set s ((NSSpeechSynthesizer alloc) initWithVoice:("com.apple.speech.synthesis.voice." stringByAppendingString:(car *voice)))) | |
(else | |
(set s ((NSSpeechSynthesizer alloc) init)))) | |
(s startSpeakingString:something) | |
(while (s isSpeaking) | |
(sleep 1))) |
This file contains 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/nush | |
;; @name utilities.nu | |
;; @description A set of utilities for Nu | |
(function ++ (num) | |
(+ 1 num)) | |
;; (puts (++ 15)) -> 16 |
This file contains 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/nush | |
(system ("open -b com.apple.Xcode \"" stringByAppendingString: ((((NSProcessInfo processInfo) arguments) objectAtIndex:2) stringByAppendingString:"\""))) |
This file contains 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
(puts (eval (parse (((NSProcessInfo processInfo) arguments) objectAtIndex:2)))) |
This file contains 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
(* | |
Prints mail messages to PDF, then deletes the message. | |
You must first set up your keyboard shortcut as shown here: | |
http://www.macsparky.com/blog/2008/3/19/keyboard-shortcut-for-save-as-pdf-in-os-x.html | |
The MIT License | |
Copyright (c) 2010. Larry Staton Jr. |
This file contains 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
// In this case, we want the window from Cib to become our full browser window | |
[theWindow setFullBridge:YES]; | |
// Instantiate the LayoutManager | |
[LayoutManager sharedManager]; |
This file contains 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
find ~/Library/Application\ Support/TextMate/Bundles -iname "*.tmbundle" | parallel 'cd {};git pull' | osascript -e 'tell application "TextMate" to reload bundles' |