I hereby claim:
- I am ryanmcgrath on github.
- I am ryanmcgrath (https://keybase.io/ryanmcgrath) on keybase.
- I have a public key ASBoiGzjRfuni2cjo3ZESQ0S9NqFGkb9ork8wK-_fciOJgo
To claim this, I am signing this object:
# pip install twython to get this library | |
from twython import Twython | |
# Create a new App at https://dev.twitter.com/, check off "sign in via Twitter", and get your tokens there | |
twitter = Twython('Consumer API Key', 'Consumer API Secret', 'Access Token', 'Access Token Secret') | |
# Read and upload the image, see image guidelines in post above~ | |
image = open('path/to/image.png', 'rb') | |
twitter.update_profile_image(image=image) |
override func touchesEnded(with event: NSEvent) { | |
if(self.isTracking) { | |
self.endTracking(leftAnchor?.constant ?? 0) | |
} | |
} | |
override func touchesCancelled(with event: NSEvent) { | |
if(self.isTracking) { | |
self.endTracking(leftAnchor?.constant ?? 0) | |
} |
override func touchesMoved(with event: NSEvent) { | |
if(!isTracking) { return } | |
let currentTouches = event.touches(matching: .touching, in: view) | |
if(currentTouches.count != 2) { return } | |
currentTouchOne = nil | |
currentTouchTwo = nil | |
currentTouches.forEach { (touch: NSTouch) in |
override func touchesBegan(with event: NSEvent) { | |
if(isTracking) { return } | |
let initialTouches = event.touches(matching: .touching, in: view) | |
if(initialTouches.count != 2) { return } | |
isTracking = true | |
initialPoint = view.convert(event.locationInWindow, from: nil) | |
let touches = Array(initialTouches) |
class HolidayCalendarCollectionViewItem: NSCollectionViewItem { | |
var leftAnchor: NSLayoutConstraint? | |
var initialTouchOne: NSTouch? | |
var initialTouchTwo: NSTouch? | |
var currentTouchOne: NSTouch? | |
var currentTouchTwo: NSTouch? | |
var initialPoint: CGPoint? | |
var isTracking = false | |
public lazy var contentView: NSView = { |
{ | |
"window": { | |
"backgroundColor": {"r": 35, "g": 108, "b": 218}, | |
"defaultWidth": 800, | |
"defaultHeight": 600 | |
}, | |
"root": { | |
"backgroundColor": {"r": 35, "g": 108, "b": 218} | |
}, |
var stfu = function(msg) { | |
if(!/\#DEBUG/.test(window.location.href)) return false; | |
/* Opera has a totally different friggin' API, but | |
it's actually fairly useful for IE debugging as their | |
VMs have some layer of compatibility. | |
*/ | |
if(window.opera) window.opera.postError(msg); | |
/* Now we try for the sweet sweet lovin'... */ |
I hereby claim:
To claim this, I am signing this object:
try: | |
# This module is only available when running under uwsgi | |
# in production. We try to import it, but if it fails we're | |
# running in development and should just pass a decorator that'll | |
# run it back immediately. | |
from uwsgidecorators import spool | |
except: | |
def spool(fn): | |
def _spool(**kwargs): | |
return fn(kwargs) |
- (BOOL)application:(UIApplication *)application | |
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; | |
self.window.backgroundColor = [UIColor whiteColor]; | |
UIViewController *rootViewController = [[MyUIViewControllerSubclass alloc] init]; | |
UINavigationController *navController = [[UINavigationController alloc] | |
initWithRootViewController:rootViewController]; | |