Skip to content

Instantly share code, notes, and snippets.

View PaulSolt's full-sized avatar

Paul Solt PaulSolt

View GitHub Profile
@mattbierner
mattbierner / image.html
Last active December 5, 2018 15:00
Automatic migration of ghost images to Jekyll
<figure class="image">
{% capture image_src %}{% if include.file %}/content/{{ page.path | remove_first:'_posts/' | split:'.' | first }}/{{ include.file }}{% else %}{{ include.url }}{% endif %}{% endcapture %}
<a href="{{ image_src }}">
<img src="{{ image_src }}" alt="{{ include.description }}" />
</a>
{% if include.description %}
<figcaption>{{ include.description }}</figcaption>
{% endif %}
</figure>
@jfro
jfro / re-create-sims.rb
Created March 9, 2015 20:47
re-creates simulators stuck in "Creating" state from Xcode 6.2 update
#!/bin/env ruby
deviceTypes = {
"iPhone 4s" => "com.apple.CoreSimulator.SimDeviceType.iPhone-4s",
"iPhone 5" => "com.apple.CoreSimulator.SimDeviceType.iPhone-5",
"iPhone 5s" => "com.apple.CoreSimulator.SimDeviceType.iPhone-5s",
"iPhone 6 Plus" => "com.apple.CoreSimulator.SimDeviceType.iPhone-6-Plus",
"iPhone 6" => "com.apple.CoreSimulator.SimDeviceType.iPhone-6",
"iPad 2" => "com.apple.CoreSimulator.SimDeviceType.iPad-2",
"iPad Retina" => "com.apple.CoreSimulator.SimDeviceType.iPad-Retina",
@bmatcuk
bmatcuk / symbolizing_osx_crash_logs.md
Created May 29, 2014 21:43
How to symbolize OSX crash logs

How to Symbolize OSX Crash Logs

Unfortunately, xcode does not yet have support for importing OSX crash logs and symbolizing them. Therefore, you must use the command line and a little bit of manual work.

  1. Find your dSYM file.
    1. Assuming you are using xcode's archive functionality, open the Organizer window from the Window menu.
    2. Click the Archives tab.
    3. Right click on the appropriate build and select Show in Finder.
    4. When Finder opens, right click on the selected archive and select Show Package Contents.
    5. Navigate to the dSYM directory and copy the appropriate dSYM file to a temporary directory.
  2. Then navigate to Products, then Applications, and copy the app file to the same temporary directory.
@joshavant
joshavant / observer_pattern.md
Created April 17, 2014 22:04
Handy little design pattern that lets you kick off processes in arbitrary objects + lets arbitrary dependencies add themselves into a notification chain

##XXAppDelegate.m, XXSomeView.m, some other object, etc##

...
[[XXSomeSingletonController sharedInstance] doThatThing];
...

##XXSomeSingletonControllerObserver.h##

@protocol XXSomeSingletonControllerObserver 
@ethanmick
ethanmick / Game.m
Created January 4, 2014 16:30
Loading the Menu from Cocos2D
- (void)openMenu:(CCMenuItem *)item;
{
// UI KITTTTTTTTTT
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"DMMainMenu_iPhone" bundle:nil];
UIViewController *menu = [storyboard instantiateViewControllerWithIdentifier:@"DMMainMenuNavigationController"];
menu.modalPresentationStyle = UIModalPresentationFullScreen;
menu.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
if (menu) {
[[CCDirector sharedDirector] presentViewController:menu animated:YES completion:^{
[[CCDirector sharedDirector] pause];

Greetings, NSHipsters!

As we prepare to increment our NSDateComponents -year by 1, it's time once again for NSHipster end-of-the-year Reader Submissions! Last year, we got some mind-blowing tips and tricks. With the release of iOS 7 & Mavericks, and a year's worth of new developments in the Objective-C ecosystem, there should be a ton of new stuff to write up for this year.

Submit your favorite piece of 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!

Here are a few examples of the kind of things I'd like to see:

  • Using NSStringFromSelector(@selector()) as a safer way to do KVC / KVO / NSCoding.
  • Panic's [rather surprising discovery about the internals of the Lightning Digital AV Adapter](http://www.panic.com/blog/the-lightning-di
@eternalstorms
eternalstorms / NSSharingServicePicker+ESSSharingServicePickerMenu.h
Created November 22, 2012 18:50
A category on NSSharingServicePicker to create a menu that can be used as a sharing submenu or main menu
//
// NSSharingServicePicker+ESSSharingServicePickerMenu.h
//
// Created by Matthias Gansrigler on 22.11.12.
// Copyright (c) 2012 Eternal Storms Software. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@interface NSSharingServicePicker (ESSSharingServicePickerMenu)
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream