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
from itertools import islice | |
import os | |
import sys | |
import subprocess | |
CMD = "sudo -u hdfs /usr/lib/hadoop/bin/hadoop dfsadmin -report" | |
def parse(resultstr): | |
dic = {} | |
for line in islice(resultstr, 0, 8): |
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 macruby | |
framework 'Cocoa' | |
urls = ARGV.map {|a| NSURL.fileURLWithPath(a) } | |
run = true | |
complete = lambda {|n, e| run = false } | |
NSWorkspace.sharedWorkspace.recycleURLs(urls, completionHandler: complete) | |
rl = NSRunLoop.currentRunLoop |
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
source "http://rubygems.org" | |
gem "ruby-mp3info" | |
gem "taglib-ruby" |
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
((nil . ((ffip-patterns . ("*.scala" "*.py"))) )) |
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
import time | |
import signal | |
def main(): | |
d = {} | |
d["stop"] = False | |
def sighandler(signum, frame): | |
print signum, frame | |
d["stop"] = True |
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
def paren(n): | |
if n == 1: | |
return ['()'] | |
results = paren(n-1) | |
coms = set() | |
for i in results: | |
coms.add('()'+i) | |
coms.add('('+i+')') | |
coms.add(i+'()') | |
return coms |
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
upstream streamer { | |
server 192.168.1.139:443; | |
} | |
# HTTPS server | |
# | |
server { | |
listen 443; | |
server_name woodstock; |
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
import sys | |
rl = lambda: sys.stdin.readline().strip() | |
def perm(strl): | |
if len(strl) == 1: | |
return [strl] | |
perms = [] | |
for i in strl: | |
copied = strl[:] |
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
#import <Cocoa/Cocoa.h> | |
@interface Delegate : NSObject { } | |
@end | |
@implementation Delegate | |
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) aBool | |
{ | |
[[NSApplication sharedApplication] terminate: nil]; | |
} |
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
import os | |
import signal | |
import time | |
def main(): | |
commands = [ | |
("python", "sample.py"), | |
("python", "sample.py"), | |
] |
NewerOlder