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
// NSURLConnection wrapper | |
// like NSURLConnection, requires a runloop, callbacks happen in runloop that set up load | |
@interface LDURLLoader : NSObject | |
{ | |
NSURLConnection *_connection; | |
NSTimeInterval _timeout; | |
NSTimer *_timeoutTimer; | |
NSURLResponse *_response; | |
long long _responseLengthEstimate; | |
NSMutableData *_accumulatedData; |
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
/* | |
Licensed under the MIT License | |
Copyright (c) 2011 Cédric Luthi | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
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/python | |
import re | |
import os | |
import pprint | |
import subprocess | |
import time | |
import Levenshtein | |
######################################################################## |
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
# requires root permissions in /usr/bin/ | |
star = String.new | |
8.times { star += "*" } | |
Star = "\n#{star * 3}\n" | |
def newblock string | |
puts "\n#{Star}#{string}#{Star}\n" | |
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
long windowId = kCGNullWindowID; | |
CGRect *temp = new CGRect; | |
// get all windows on the current screen | |
CFArrayRef windowList = CGWindowListCopyWindowInfo(kCGWindowListOptionAll | kCGWindowListOptionOnScreenOnly, kCGNullWindowID); | |
// find the current window, that will be the first one on layer 0 | |
CFIndex windowNum = CFArrayGetCount(windowList); | |
for (int i=0;i<(int)windowNum;i++) { | |
CFDictionaryRef info = (CFDictionaryRef)CFArrayGetValueAtIndex(windowList, i); |