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
#!/bin/sh | |
# | |
# usage: retrieve-cert.sh remote.host.name [port] | |
# | |
if [ $# -eq 0 -o $# -gt 2 ]; then | |
echo `basename $0`" <host> <port:443>" | |
exit | |
fi |
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
/** | |
* cc -Wall -fno-objc-arc -framework Foundation -o array_of_blocks array_of_blocks.mm | |
* Based on http://orangejuiceliberationfront.com/blocks-and-block-lists/ from Uli Kusterer | |
*/ | |
#import <Foundation/Foundation.h> | |
@interface NSMutableArray (BlocksArray) | |
- (void)startExecutingBlocks; | |
- (void)executeNextBlock; | |
@end |
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
require 'tempfile' | |
def pbcopy(s) | |
tmp_file = Tempfile.new("pbcopy") | |
begin | |
tmp_file.write(s.to_s) | |
tmp_file.rewind | |
system "/bin/cat #{tmp_file.path} | /usr/bin/pbcopy" | |
ensure | |
tmp_file.close |
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 bash | |
if [ $# != 0 -a $# != 2 ]; then | |
echo `basename $0`" <cols> <rows>" | |
exit | |
fi | |
COLS=${1:-80} | |
ROWS=${2:-25} |
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 xcrun swift -i | |
extension Array { | |
func each(closure:(T) -> ()) { | |
for item:T in self { | |
closure(item) | |
} | |
} | |
func eachWithIndex(closure:(Int, T) -> ()) { | |
var i:Int = 0 |
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
(*** | |
Use this AppleScript to launch WWDC 2014 videos in QuickTime Player 7, where | |
you can adjust the playback speed to your needs (⌘ + k). Have fun! | |
Christian Mittendorf, 15.06.2014 | |
cmittendorf<et>me.com | |
***) | |
set page_url to "https://developer.apple.com/videos/wwdc/2014/" | |
set videos to missing value |
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 bash | |
# prepared for Yosemite (10.10) | |
# osascript -l JavaScript -e "Application('Safari').documents()[0].text()" | |
CONTENT=$(osascript -ss << EOF | |
tell application "Safari" | |
tell its first document | |
get its text | |
end tell |
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 bash | |
URL=$(osascript << EOF | |
tell application "Safari" | |
tell its first document | |
URL | |
end tell | |
end tell | |
EOF) |
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
(** | |
Create new files or folders with a keystroke and by using the Tool | |
FastScripts http://www.red-sweater.com/fastscripts/ | |
you can overwrite the default Finder Shift-Command-N shortcut | |
to create a new folder for invoking our new script. | |
**) | |
tell application "Finder" | |
-- default name for a new file following | |
-- the Finders convention for naming folders | |
set newFileName to "untitled file" |
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 bash | |
function log() | |
{ | |
echo `date +"[%d.%m.%Y %H:%M:%S] "`$1 | |
# Available Sounds: | |
# Basso, Blow, Bottle, Frog, Funk, Glass, Hero, | |
# Morse, Ping, Pop, Purr, Sosumi, Submarine, Tink | |
osascript << EOF |
OlderNewer