- Set Light mode
defaults write -g NSRequiresAquaSystemAppearance -bool Yes
- Log out and log back in
- Set Dark mode
- (NSString*)localizedRelativeTime { | |
NSDateComponentsFormatter *formatter = [[NSDateComponentsFormatter alloc] init]; | |
formatter.allowedUnits = NSCalendarUnitHour | NSCalendarUnitMinute; | |
formatter.unitsStyle = NSDateComponentsFormatterUnitsStyleShort; | |
if (self.timeIntervalSinceNow < 60 && self.timeIntervalSinceNow > -60) { | |
return NSLocalizedString(@"right now", @"from MapKit/Maps"); | |
} else if (self.timeIntervalSinceNow > 0) { | |
NSString *start = [formatter stringFromDate:NSDate.date toDate:self]; | |
return [NSString stringWithFormat:NSLocalizedString(@"in %@", @"placeholder: minutes/hours"), start]; | |
} else { |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
/* GitHub */ | |
/* project view */ | |
/* pack columns tighter together */ | |
div.project-columns-container > div { | |
margin-right: 8px !important; | |
} | |
/* reduce card to column spacing */ |
# tilesheet.rb | |
# | |
# This is for loading tile sheets that either have padding between the tiles, | |
# do not take up the whole of the image, or both. The normal Gosu method for | |
# loading from tiles doesn't work if there is padding or the tiles themselves | |
# are not wall-to-wall on the sheet. This can load such a sheet, though you | |
# will need to know how many tiles there are both wide and tall, as there's no | |
# way to guess on such a sheet. You'll also need to make sure the sheet is a | |
# power-of-two in size. You can do this by adjusting the sheet to 512x512 or | |
# 1024x1024, just add empty space if needed. |
// http://twitter.com/nicklockwood/status/690540488433274881 | |
// @0xced hmm, you're right. So under what circumstances *does* it populate the error param? Why even have it at all? | |
// http://twitter.com/0xced/status/690543445404991488 | |
// @nicklockwood Just disassembled again, seems it can errors if a string fails to convert to UTF8. @nst021 Idea how to produce such a string? | |
// http://twitter.com/mikeash/status/690564095322542081 | |
// mikeash: @0xced @nicklockwood @nst021 Maybe try an NSString containing half of a surrogate pair. | |
#import <Foundation/Foundation.h> |
/* | |
* Random-Number Utilities (randutil) | |
* Addresses common issues with C++11 random number generation. | |
* Makes good seeding easier, and makes using RNGs easy while retaining | |
* all the power. | |
* | |
* The MIT License (MIT) | |
* | |
* Copyright (c) 2015-2022 Melissa E. O'Neill | |
* |
This is the code path that changed the status bar orientation on iOS 7: | |
* thread #1: tid = 0x698dbf, 0x00085830 WindowRotationIssue`-[AppDelegate application:willChangeStatusBarOrientation:duration:](self=0x7a041f90, _cmd=0x0137a18d, application=0x79e39cc0, newStatusBarOrientation=UIInterfaceOrientationPortraitUpsideDown, duration=0.80000000000000004) + 96 at AppDelegate.m:23, queue = 'com.apple.main-thread', stop reason = breakpoint 3.1 | |
* frame #0: 0x00085830 WindowRotationIssue`-[AppDelegate application:willChangeStatusBarOrientation:duration:](self=0x7a041f90, _cmd=0x0137a18d, application=0x79e39cc0, newStatusBarOrientation=UIInterfaceOrientationPortraitUpsideDown, duration=0.80000000000000004) + 96 at AppDelegate.m:23 | |
frame #1: 0x00bb6ab5 UIKit`-[UIApplication setStatusBarOrientation:animationParameters:notifySpringBoardAndFence:] + 242 | |
frame #2: 0x00bfa8e4 UIKit`-[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 4761 | |
frame #3: 0x00bf9646 UIKit`-[UIWi |
Season's Greetings, NSHipsters!
As the year winds down, and we take a moment to reflect on our experiences over the past months, one thing is clear: 2014 has been an incredible year professionally for Apple developers. So much has happened in such a short timespan, and yet it's hard to remember our relationship to Objective-C before Swift, or what APIs could have captivated our imagination as much as iOS 8 or WatchKit.
It's an NSHipster tradition to ask you, dear readers, to send in your favorite tips and tricks from the past year for publication over the New Year's holiday. This year, with the deluge of new developments—both from Cupertino and the community at large—there should be no shortage of interesting tidbits to share.
Submit your favorite piece of Swift or Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!
If you're wondering about what to post, look to
-
Download a Kindle-compatible version of the dictionary here. Unzip the .rar archive.
-
Get the "Send to Kindle" program on your computer. Here's the link for the Mac.
-
Right-click your recently downloaded (unzipped) dictionary file, and click the "Send to Kindle" menu item. It will arrive on your Kindle shortly.
-
Once the dictionary has arrived, go to your settings -- on my newish paperwhite, it's at Home > Settings > Device Options > Language and Dictionaries > Dictionaries > English. Choose the Webster's 1913.