Skip to content

Instantly share code, notes, and snippets.

View philosopherdog's full-sized avatar

Steve Thompson philosopherdog

View GitHub Profile
@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active June 23, 2025 15:52
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active July 11, 2025 21:46
The best FRP iOS resources.

Videos

@JadenGeller
JadenGeller / AnyEquatable.swift
Last active May 21, 2025 08:58
AnyEquatable
public struct AnyEquatable: Equatable {
private let value: Any
private let equals: Any -> Bool
public init<E: Equatable>(_ value: E) {
self.value = value
self.equals = { ($0 as? E == value) ?? false }
}
}

Declaring models

class Dog: Object {

  dynamic var id = ""

  dynamic var name = ""

 dynamic var tempVariable = ""
@philosopherdog
philosopherdog / .gitignore_global
Last active March 7, 2019 04:19
setup gitignore_global for Xcode
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
@frankchang0125
frankchang0125 / collectionView_setContentOffset.swift
Last active November 9, 2022 19:44
Scroll to the offset after reloading collectionView
/* We call layoutIfNeeded() immediately after reloadData()
* to force collection view to perform layout immediately
* This is required to let the setContentOffset() in dispatch block to be executed
* after collection view has completed performing its layout to scroll to the correct offset
* For further explanations, please see: http://goo.gl/BpzlA5 and http://goo.gl/6CH64b
*/
self.collectionView.reloadData()
self.collectionView.layoutIfNeeded()
dispatch_async(dispatch_get_main_queue(), {
@nicholasknight
nicholasknight / adv2notes.md
Last active March 25, 2025 16:12
Kinesis Advantage 2 notes

(NOTE: Current and future versions of this and any other Advantage 2-related things I post will be at https://github.com/nicholasknight/adv2keyboard)

I received my Advantage 2 today. There's no full manual yet, even though keyboards are apparently arriving (hint, hint, Kinesis). The quick start guide leaves out the "power user mode", and there are some other quirks.

Update: A manual has been posted at http://www.kinesis-ergo.com/advantage2-resources/

It includes a dictionary for the key maps, but I know it leaves at least one possible key undocumented: it does not list f14, but I have successfully mapped my scrollock to f14 regardless.

It also mentions a firmware version (1.0.18) that doesn't seem to be available yet, with a new feature (status report playback speed).

import Foundation
final class Sample: NSObject {
@objc dynamic var name: String = ""
}
class MyObj: NSObject {
@objc dynamic var test: String = ""
}
extension NSObjectProtocol where Self: NSObject {
@kean
kean / AutoRetry.swift
Last active November 2, 2024 15:47
Smart Auto Retry using RxSwift
// The MIT License (MIT)
//
// Copyright (c) 2017 Alexander Grebenyuk (github.com/kean).
import Foundation
import RxSwift
import RxCocoa
extension ObservableType {
@philosopherdog
philosopherdog / CURL-cheatsheet.md
Created January 25, 2018 18:57 — forked from Kartones/CURL-cheatsheet.md
CURL Cheatsheet
  • XML GET
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "http://hostname/resource"
  • JSON GET
curl -i -H "Accept: application/json" -H "Content-Type: application/json" -X GET "http://hostname/resource"
  • JSON PUT