Updated this for the first time in awhile in late 2020.
- Enable iCloud
- Disable iCloud mail
- Display to medium
- Turn up trackpad speed
#!/usr/bin/env ruby | |
## WP2TUMBLR: WordPress 2 Tumblr Importing tool | |
## | |
## Usage: wp2tumblr [OPTION] WORDPRESS_XML_FILE | |
## | |
## Import the WORDPRESS_XML_FILE to a Tumblr blog. | |
## Provide `--group` option to publish to a group. | |
## This could take a long time... | |
## | |
## To install, download the script and chmod to 755. |
#define B(x) x; printf("{ B(" #x ") }\n"); | |
int main() | |
{ B(printf("#define B(x) x; printf(\"{ B(\" #x \") }\\n\");\nint main()\n")) } |
Most of these guidelines are to match Apple's documentation and community-accepted best practices. Some are derived some personal preference. This document aims to set a standard way of doing things so everyone can do things the same way. If there is something you are not particularly fond of, it is encouraged to do it anyway to be consistent with everyone else.
This document is mainly targeted toward iOS development, but definitely applies to Mac as well.
NSString *foo = @"bar";
-(UIImage*) imageForAsset:(ALAsset*) aAsset{ | |
ALAssetRepresentation *rep; | |
rep = [aAsset defaultRepresentation]; | |
return [UIImage imageWithCGImage:[rep fullResolutionImage]]; | |
} |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
<title>Stripe Sample Form</title> | |
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script> | |
<script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
<script type="text/javascript"> |
Sublime Text 2 ships with a CLI called subl (why not "sublime", go figure). This utility is hidden in the following folder (assuming you installed Sublime in /Applications
like normal folk. If this following line opens Sublime Text for you, then bingo, you're ready.
open /Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl
You can find more (official) details about subl here: http://www.sublimetext.com/docs/2/osx_command_line.html
IB is awful. Take the following scenario:
Say you want to make a view,
MyView
. You makeMyView.h
,MyView.m
, andMyView.xib
.You add a button to the view with an outlet and an action and implement that in your class.
Now, say you want to use MyView in another class without the button. You add it, launch, and it crashes. You didn't add the outlet, so you get a KVO error. Crap. You add useless code so it will launch. Ugh.
Now, you add some new functionality at the last minute to your awesome
MyView
to do other stuff. Launch and test it in your second spot. All is good. A few days, later you get a rejection email from Apple. Wha?! Oh, you didn't test you updated my view in the first spot, which is now crashing because you renamed something or added a new outlet.
Hi David, | |
I came across your profile online and wanted to reach out about Development | |
Opportunities here at Groupon. The company is growing, and we're always | |
looking for folks with solid skills that can make positive contribution to | |
our continued success. Any chance you'd be open to a quick conversation | |
about opportunities, or for any possible networking potential? If so, let me | |
know when you're free and we can set up a time to chat. Also, if you are | |
interested, it would be great if you could forward a current resume over | |
that I can take a look at. I look forward to hearing back from you! Please | |
let me know if you have any questions. |
// Resizes the image according to the given content mode, taking into account the image's orientation | |
- (UIImage *)resizedImageWithContentMode:(UIViewContentMode)contentMode imageToScale:(UIImage*)imageToScale bounds:(CGSize)bounds interpolationQuality:(CGInterpolationQuality)quality { | |
//Get the size we want to scale it to | |
CGFloat horizontalRatio = bounds.width / imageToScale.size.width; | |
CGFloat verticalRatio = bounds.height / imageToScale.size.height; | |
CGFloat ratio; | |
switch (contentMode) { | |
case UIViewContentModeScaleAspectFill: | |
ratio = MAX(horizontalRatio, verticalRatio); |