Skip to content

Instantly share code, notes, and snippets.

Stephen Ryner Jr. nuthatch

Block or report user

Report or block nuthatch

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nuthatch
nuthatch / fix macOS.bash
Created Aug 11, 2019
The three macOS preferences I always set on a new machine: no desktop, no drop shadows in screenshots, and clicking app in Dock hides all other apps
View fix macOS.bash
#!/bin/bash
# hide Desktop clutter (Desktop is just a folder in Finder)
defaults write com.apple.finder CreateDesktop false
killall Finder
# enable "Purple Button Mode"
# see https://tidbits.com/2009/10/06/revealing-mac-os-xs-hidden-single-application-mode/
defaults write com.apple.dock single-app -bool true
killall Dock
View Text Substitutions.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>shortcut</key>
<string>:smile:</string>
<key>phrase</key>
<string>😄</string>
</dict>
@nuthatch
nuthatch / iOS 9 Dynamic Font Mappings
Last active Jun 14, 2016
iOS 9 replaces Helvetica Nue with the new San Francisco font
View iOS 9 Dynamic Font Mappings
- (void)describePreferredFonts
{
static NSArray *textStyles;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
textStyles = @[UIFontTextStyleTitle1, // iOS 9
UIFontTextStyleTitle2, // iOS 9
UIFontTextStyleTitle3, // iOS 9
UIFontTextStyleHeadline,
UIFontTextStyleSubheadline,
View pixelspace_solarsystem essay
Pretty empty out here.
Here comes our first planet…
As it turns out, things are pretty far apart.
We’ll be coming up on a new planet soon.
Sit tight.
Most of space is just space.
Halfway home.
Destination: Mars!
It would take about seven months to travel this distance in a spaceship.
Better be some good in-flight entertainment.
View iOS-store-languages
Chinese (Simplified)
China (CN)
Chinese (Traditional)
Taiwan (TW)
Macau (MO)
Danish
Denmark (DK)
@nuthatch
nuthatch / bad-traceroute.txt
Created Dec 1, 2013
ping times at 10:57 CST on Sunday, December 1st
View bad-traceroute.txt
~ $ traceroute comcast.net
traceroute: Warning: comcast.net has multiple addresses; using 69.252.80.75
traceroute to comcast.net (69.252.80.75), 64 hops max, 52 byte packets
1 10.0.1.1 (10.0.1.1) 1.005 ms 0.632 ms 0.664 ms
2 * * *
3 * * *
4 * * *
5 * * *
6 * * *
7 * * *
@nuthatch
nuthatch / describeAllFonts
Created Nov 22, 2013
method to describe all fontName in iOS 7, ordered alphabetically. Also: all the fonts found in 7.0.3.
View describeAllFonts
+ (void)describeAllFonts
{
NSMutableArray *fonts = [NSMutableArray array];
NSArray *familyNames = [UIFont familyNames];
for (NSString *familyName in familyNames)
{
NSArray *fontNames = [UIFont fontNamesForFamilyName:familyName];
for (NSString *fontName in fontNames)
{
UIFont *font = [UIFont fontWithName:fontName size:14];
@nuthatch
nuthatch / preferred Content Size description
Created Nov 22, 2013
Map preferredContentSizeCategory into a human-readable string, e.g. UIContentSizeCategoryAccessibilityMedium becomes "Accessibility Medium"
View preferred Content Size description
+ (NSString *)preferredContentSizeDescription
{
// see http://johnszumski.com/blog/implementing-dynamic-type-on-ios7
NSString *contentSize = [UIApplication sharedApplication].preferredContentSizeCategory;
NSString *description;
if ([contentSize rangeOfString:@"Accessibility"].location != NSNotFound)
{
// Accessibility Content Size Category Constants
@nuthatch
nuthatch / iOS 7 dynamic font mappings
Last active Sep 11, 2019
What is UIFontTextStyleHeadline *really*? Dump out preferredFontForTextStyle for UIFontTextStyleHeadline, UIFontTextStyleSubheadline, UIFontTextStyleBody, UIFontTextStyleFootnote, UIFontTextStyleCaption1, UIFontTextStyleCaption2 to examine the font name, weight, and point size.
View iOS 7 dynamic font mappings
+ (void)describePreferredFonts
{
static NSArray *textStyles;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
textStyles = @[UIFontTextStyleHeadline,
UIFontTextStyleSubheadline,
UIFontTextStyleBody,
UIFontTextStyleFootnote,
UIFontTextStyleCaption1,
@nuthatch
nuthatch / NSManagedObject+Serialization.h
Last active May 8, 2019 — forked from pkclsoft/NSManagedObject+Serialization.h
Fixes for Peter Easdown's category 1. don't assume each Entity name matches the Class name. 2. strip DATE_ATTR_PREFIX when deserializing dates back into NSManagedObject 3. add support for NSOrderedSet 4. use set to keep traversal history, and allow classes to opt-out with serializationObjectsToSkip
View NSManagedObject+Serialization.h
@interface NSManagedObject (Serialization)
- (NSDictionary*) toDictionary;
- (void) populateFromDictionary:(NSDictionary*)dict;
+ (NSManagedObject*) createManagedObjectFromDictionary:(NSDictionary*)dict
inContext:(NSManagedObjectContext*)context;
@end
You can’t perform that action at this time.