Skip to content

Instantly share code, notes, and snippets.

🐫
🥶

Steve Moser stevemoser

🐫
🥶
Block or report user

Report or block stevemoser

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
@0xced
0xced / Emoji.json
Last active Feb 2, 2018
Extract emoji by category using the EmojiFoundation framework
View Emoji.json
{
"People" : [
"😀",
"😃",
"😄",
"😁",
"😆",
"😅",
"😂",
"🤣",
@b3ll
b3ll / UIActivityViewControllerPreheat.swift
Created Feb 21, 2017
UIActivityViewController is crazy slow :(
View UIActivityViewControllerPreheat.swift
// Preheat the UIActivityViewController because it's crazy slow.
let activityViewController = UIActivityViewController(activityItems: [ UIImage(named: "Halo.jpg")! ], applicationActivities: nil)
activityViewController.view.alpha = 0.0
let fakeViewController = UIViewController()
fakeViewController.present(activityViewController, animated: false) {
activityViewController.dismiss(animated: false, completion: nil)
}
@ethanhuang13
ethanhuang13 / xcode-beta-slink.sh
Last active Sep 11, 2019
Symbolic link from Xcode.app to Xcode-beta.app (Xcode 11)
View xcode-beta-slink.sh
View humble-bundle-download-all.sh
# Usage:
# 1) Ctr+S downloads page to ~/Desktop/books.html
# 2) Run script
# 3) Find your books in /tmp/humble_books
# 4) Read them
# 5) Profit
cat ~/Desktop/books.html |
grep "https://dl.humble.com" |
sed -n -E 's/.data-web\=\"(https://dl.humble.com/([.]+).([a-z]+)?["]+)./\1 \2 \3/p' |
sed 's/&/&/g' > /tmp/humble_books_list && cat /tmp/humble_books_list |
@danielctull
danielctull / AppDelegate.m
Last active Apr 12, 2019
Shows selection of table view cells on pressing the up/down arrow keys.
View AppDelegate.m
@implementation AppDelegate
#pragma mark - Key Command Controller
- (KeyCommandController *)keyCommandController {
if (!_keyCommandController) {
UIViewController *rootViewController = self.window.rootViewController;
if (rootViewController){
@gonzalolarralde
gonzalolarralde / tvos_prohibited.md
Last active Aug 22, 2019
Classes and Methods prohibited to tvOS
View tvos_prohibited.md
$ grep -lR "__TVOS_PROHIBITED" . | while read L; do echo "## $L"; echo "\`\`\`obj-c"; grep "__TVOS_PROHIBITED" "$L"; echo "\`\`\`"; echo; done

./AVFoundation.framework/AVAudioSession.h

AVAudioSessionPortOverrideSpeaker __TVOS_PROHIBITED = 'spkr'

AVAudioSessionCategoryOptionAllowBluetooth	__TVOS_PROHIBITED		= 0x4,
AVAudioSessionCategoryOptionDefaultToSpeaker __TVOS_PROHIBITED		= 0x8,
@fastred
fastred / NS_SWIFT_UNAVAILABLE.md
Last active Mar 1, 2017
NS_SWIFT_UNAVAILABLE
View NS_SWIFT_UNAVAILABLE.md

Results of searching for NS_SWIFT_UNAVAILABLE macro in iOS 9 and OS X 10.11 headers reveal some new Swift-specific APIs.

Highlights

GameplayKit.framework/Headers/GKEntity.h
70: - (nullable GKComponent *)componentForClass:(Class)componentClass
NS_SWIFT_UNAVAILABLE("Exposed in Swift as componentForClass<ComponentType: GKComponent>(componentClass: ComponentType.Type) -> ComponentType?");

GameplayKit.framework/Headers/GKStateMachine.h
@matthewmueller
matthewmueller / osx-for-hackers.sh
Last active Oct 13, 2019
OSX for Hackers (Mavericks/Yosemite)
View osx-for-hackers.sh
# OSX for Hackers (Mavericks/Yosemite)
#
# Source: https://gist.github.com/brandonb927/3195465
#!/bin/sh
# Some things taken from here
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# Ask for the administrator password upfront
@steipete
steipete / UITableViewMore.m
Last active Jan 29, 2018
Using the "More" button. Of course the simple way that Apple uses in Mail/iOS is not public. rdar://16600859
View UITableViewMore.m
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
return @"More";
}
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath {
NSLog(@"I wanted to be a pretty public API, but then time ran out and they forgot me...");
// Hide the More/Delete menu.
[self setEditing:NO animated:YES];
}
@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,
You can’t perform that action at this time.