Skip to content

Instantly share code, notes, and snippets.

View PaulSolt's full-sized avatar

Paul Solt PaulSolt

View GitHub Profile
@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
@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.
@miguelmota
miguelmota / mount_fat32.sh
Last active March 13, 2024 15:49
OS X mount FAT32 partition with read/write permissions
diskutil list
diskutil unmount /dev/disk0s6
sudo mount -w -t msdos /dev/disk0s6 /Volumes/data
@danieleggert
danieleggert / iOS_sysdiagnose.md
Created February 6, 2018 14:14
How to trigger a sysdiagnose on iOS

How To sysdiagnose on iOS:

  1. Hold volume up + volume down + power for 250 milliseconds.
  2. Wait (up to 5 minutes)
  3. Settings.app > Privacy > Analytics > Analytics Data
  4. Select the "sysdiagnose_" file and share via AirDrop to a Mac.
@joshavant
joshavant / UIView+Utility.swift
Created November 17, 2018 07:40
Ambiguity Treadmill
extension UIView {
@objc func exerciseAmbiguityInLayoutRepeatedly() {
if self.hasAmbiguousLayout {
Timer.scheduledTimer(timeInterval: 0.5,
target: self,
selector: #selector(UIView.exerciseAmbiguityInLayout),
userInfo: nil,
repeats: true)
}
}

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
@stinger
stinger / CombineFetcher.swift
Last active January 28, 2023 18:07
Combine - fetching data using URLSession publishers
import Foundation
import Combine
enum APIError: Error, LocalizedError {
case unknown, apiError(reason: String)
var errorDescription: String? {
switch self {
case .unknown:
return "Unknown error"
@endy-s
endy-s / String.swift
Last active October 21, 2022 04:03
Compare two String Versions
extension String {
func getRawVersionString() -> String? {
return self.removePrefix("v")
.split(separator: "-")
.first?.toString()
}
// Modified from the DragonCherry extension - https://github.com/DragonCherry/VersionCompare
private func compare(toVersion targetVersion: String) -> ComparisonResult {
let versionDelimiter = "."
@froggomad
froggomad / NetworkService.swift
Last active June 24, 2020 16:22
Network Helper Class
import Foundation
protocol NetworkLoader {
func loadData(using request: URLRequest, with completion: @escaping (Data?, HTTPURLResponse?, Error?) -> Void)
}
extension URLSession: NetworkLoader {
/// Asyncronously load data using a URL Request
/// - Parameters:
/// - request: an unwrapped URLRequest
@JohnSundell
JohnSundell / OnboardingManager.swift
Last active May 21, 2020 08:19
An example of using #function for user defaults properties, and a test that guards against property name changes
import UIKit
class OnboardingManager {
private let userDefaults: UserDefaults
init(userDefaults: UserDefaults = .standard) {
self.userDefaults = userDefaults
}
func presentOnboardingControllerIfNeeded(in viewController: UIViewController) {