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/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 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/bin/env bash | |
if [ $# != 0 -a $# != 2 ]; then | |
echo `basename $0`" <cols> <rows>" | |
exit | |
fi | |
COLS=${1:-80} | |
ROWS=${2:-25} |
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
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 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
/** | |
* 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 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 | |
# | |
# usage: retrieve-cert.sh remote.host.name [port] | |
# | |
if [ $# -eq 0 -o $# -gt 2 ]; then | |
echo `basename $0`" <host> <port:443>" | |
exit | |
fi |
NewerOlder