Updated this for the first time in awhile in late 2020.
- Enable iCloud
- Disable iCloud mail
- Display to medium
- Turn up trackpad speed
// | |
// NSObject+BlockObservation.h | |
// Version 1.0 | |
// | |
// Andy Matuschak | |
// andy@andymatuschak.org | |
// Public domain because I love you. Let me know how you use it. | |
// | |
#import <Cocoa/Cocoa.h> |
/* | |
* $TM_FILENAME | |
* ${1:`echo "$TM_FILEPATH" | awk -F"/" '{x=NF-1}{print $x}'`} | |
* | |
* Created by `id -P | awk -F ":" '{ print $8 }'` on `date "+%d/%m/%Y"`. | |
* | |
* Copyright (c) `date +%Y` ${2:$TM_ORGANIZATION_NAME} | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without |
/* | |
Copyright (c) 2009 Remy Demarest | |
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 furnished to do so, subject to the following |
// Released under MIT license: http://www.opensource.org/licenses/mit-license.php | |
$('[placeholder]').focus(function() { | |
var input = $(this); | |
if (input.val() == input.attr('placeholder')) { | |
input.val(''); | |
input.removeClass('placeholder'); | |
} | |
}).blur(function() { | |
var input = $(this); |
import os | |
import httplib | |
import tornado.web | |
class ErrorHandler(tornado.web.RequestHandler): | |
"""Generates an error response with status_code for all requests.""" | |
def __init__(self, application, request, status_code): | |
tornado.web.RequestHandler.__init__(self, application, request) | |
self.set_status(status_code) | |
Adds support for loading UIImage's from PDF files. I think it's a great way to add resolution-independent graphics to your apps, and also remove the "export to bitmap" step from your workflow. Just save directly from Illustrator! | |
What it does: | |
- You can pass the name of a PDF file (with or without the '.pdf') to +[UIImage imageNamed:] | |
- You can use the name of a PDF file inside Interface Builder, in your UIImageView's | |
- Turn a multi-page PDF into an array of UIImage's... good for animation. | |
Feedback to gists @nielsbot.com. Thanks! |
$ git branch -r --merged | | |
grep origin | | |
grep -v '>' | | |
grep -v master | | |
xargs -L1 | | |
awk '{split($0,a,"/"); print a[2]}' | | |
xargs git push origin --delete |
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
- (void)loadDefaultSettings | |
{ | |
NSMutableDictionary *defaults = [NSMutableDictionary dictionaryWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Default-Settings" ofType:@"plist"]]; | |
// other setup... | |
[[NSUserDefaults standardUserDefaults] registerDefaults:[NSDictionary dictionaryWithDictionary:defaults]]; | |
} | |
- (void)resetDefaultSettings |