This gist has graduated into a real repository! Check it out at dlo/growltweet.
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
# vim: set ft=python : | |
from __future__ import print_function | |
import json | |
import sys | |
import datetime | |
from redis import StrictRedis as Redis |
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 datetime | |
class FakeDateTime(datetime.datetime): | |
def __eq__(self, instance): | |
try: | |
return (self.year, self.month, self.day, self.hour, self.minute, self.second) == (instance.year, instance.month, instance.day, instance.hour, instance.minute, instance.second) | |
except: | |
return False | |
@classmethod |
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
- (void)cancelLongRunningTasks:(id)sender { | |
NSDate *date = [NSDate date]; | |
void (^CompletionHandler)(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) = ^(NSArray *dataTasks, NSArray *uploadTasks, NSArray *downloadTasks) { | |
for (NSURLSessionDownloadTask *task in downloadTasks) { | |
if (task.state == NSURLSessionTaskStateRunning) { | |
NSDate *startDate = self.sessionDownloadTaskStartDates[@(task.taskIdentifier)]; | |
if (startDate) { | |
NSTimeInterval interval = [date timeIntervalSinceDate:startDate]; | |
if (interval > 30) { |
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 | |
# Ref: http://ubuntuforums.org/showthread.php?t=1751455 | |
# Install required libs | |
apt-get -y install build-essential python-dev libjpeg62-dev zlib1g-dev libfreetype6-dev liblcms1-dev | |
# Link to correct location | |
if [ -d /usr/lib/x86_64-linux-gnu ]; then | |
# Ubuntu 11.04 64bit | |
ln -sf /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/ | |
ln -sf /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/ | |
ln -sf /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
protocol AccountLike: Equatable { | |
var accountID: String {get} | |
} | |
class Account : AccountLike { | |
let accountID = 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
#!/usr/bin/env python | |
import sys | |
from os import system | |
prog = sys.argv[1] | |
pos = prog.find(".") | |
name = prog[:pos] | |
system("8g " + prog) | |
system("8l -o %s.out %s.8" % (name, name)) |
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 python | |
""" | |
PyTextile | |
A Humane Web Text Generator | |
""" | |
__version__ = '2.1.3' | |
__date__ = '2009/02/07' |
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 python | |
""" | |
LICENSE | |
======= | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar |
OlderNewer