Skip to content

Instantly share code, notes, and snippets.

View timqzm's full-sized avatar
👨‍💻
Happy coding

Tim Kuzmin timqzm

👨‍💻
Happy coding
View GitHub Profile
# strip out iBooks citation
sed -E -e 's/^[ ]?[0-9]* //g' | sed -E -e 's/“[ ]?[0-9]?[ ]?//g' | sed -E -e 's/”$//g' | sed -E -e 's/^(Excerpt From).*//g'
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 17, 2024 06:08
The best FRP iOS resources.

Videos

@ivnsch
ivnsch / autolayout.swift
Last active August 20, 2018 00:09
Chart with autolayout
// NOTE: you may have to set the module in the storyboard to "SwiftCharts", otherwise the view may not be recognized correctly, which leads to axis, labels and guidelines not showing
class HelloWorld: UIViewController {
private var chart: Chart? // arc
@IBOutlet weak var chartView: ChartBaseView!
private var didLayout: Bool = false
@zacwest
zacwest / ios-font-sizes.swift
Last active June 17, 2024 01:38
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]
@FGoessler
FGoessler / ServiceLocator.swift
Created January 24, 2016 20:45
A very lightweight ServiceLocator implementation including a module mechanism written in Swift.
import Foundation
public protocol ServiceLocatorModul {
func registerServices(serviceLocator: ServiceLocator)
}
public class ServiceLocator {
private var registry = [ObjectIdentifier:Any]()
public static var sharedLocator = ServiceLocator()
@loderunner
loderunner / osx-ld.md
Last active June 14, 2024 22:19
potential blog posts

ld – Wading through Mac OS X linker hell

Intro

Friend: I tried looking at static linking in Mac OS X and it seems nearly impossible. Take a look at this http://stackoverflow.com/a/3801032

Me: I have no idea what that -static flag does, but I'm pretty sure that's not how you link to a library. Let me RTFM a bit.

Minutes later...

@ahernandezlopez
ahernandezlopez / CrashlyticsLogger.swift
Last active November 7, 2017 07:52 — forked from akramhussein/CrashlyticsLogger.swift
CocoaLumberjack Custom Crashlytics Logger in Swift
import Foundation
import CocoaLumberjack
import Crashlytics
class CrashlyticsLogger : DDAbstractLogger
{
static let sharedInstance = CrashlyticsLogger()
private var _logFormatter : DDLogFormatter?
override var logFormatter: DDLogFormatter? {
@benstockdesign
benstockdesign / nscollectionview-how-to.markdown
Last active May 19, 2019 15:14
How to Set Up an NSCollectionView in Xcode 7.3 (OS X 10.11)

Think NSCollectionViews are Crazy to Set Up for OS X?

You're Not Alone.

Here's a step-by-step guide on how to get these painful things working properly in Xcode 7.3 on OS X 10.11 El Capitan.

  1. Drag an NSCollectionView object into an existing storyboard or standalone nib.
  2. Select the NSCollectionView, and in the inspector, change Layout from Content Array (Legacy) to Flow.
  3. Configure the rest how you see fit.
  4. Next, add a new NSCollectionViewItem subclass to the project, naming it something like MyCollectionViewItem.
  5. Check the box next to Also create XIB file for user interface. Two files will be created.
@NikolaiRuhe
NikolaiRuhe / NRLabel.swift
Last active April 9, 2020 05:01
A UILabel subclass that adds padding around the text and handles layout properly.
import UIKit
class NRLabel : UILabel {
var textInsets = UIEdgeInsets.zero {
didSet { invalidateIntrinsicContentSize() }
}
override func textRect(forBounds bounds: CGRect, limitedToNumberOfLines numberOfLines: Int) -> CGRect {
let insetRect = UIEdgeInsetsInsetRect(bounds, textInsets)