Skip to content

Instantly share code, notes, and snippets.

Plamen Andreev plam4u

Block or report user

Report or block plam4u

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
mattt / UIViewControllerPreview.swift
Last active Feb 7, 2020
Generic structures to host previews of UIView and UIViewController subclasses.
View UIViewControllerPreview.swift
import UIKit
#if canImport(SwiftUI) && DEBUG
import SwiftUI
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable {
let viewController: ViewController
init(_ builder: @escaping () -> ViewController) {
viewController = builder()
kharrison / RSSFeed.swift
Last active Dec 9, 2019
Swift Decodable With Multiple Custom Dates
View RSSFeed.swift
import Foundation
extension DateFormatter {
static let iso8601Full: DateFormatter = {
let formatter = DateFormatter()
formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ"
formatter.calendar = Calendar(identifier: .iso8601)
formatter.timeZone = TimeZone(secondsFromGMT: 0)
formatter.locale = Locale(identifier: "en_US_POSIX")
return formatter
simme / debounce-throttle.swift
Created Dec 20, 2016
Swift 3 debounce & throttle
View debounce-throttle.swift
// debounce-throttle.swift
// Created by Simon Ljungberg on 19/12/16.
// License: MIT
import Foundation
extension TimeInterval {
ryuichis / gist:755e6297aec13c900cdf
Last active Dec 29, 2019 — forked from gavrix/gist:5054182
Script integrating OCLint into XCode. Put it in "Run script" build phase.
View gist:755e6297aec13c900cdf
source ~/.bash_profile
xcodebuild clean
xcodebuild | xcpretty -r json-compilation-database
oclint-json-compilation-database -- -report-type xcode
squarism /
Last active Feb 16, 2020
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
plam4u / DebugWithKeyboard.m
Last active Jan 10, 2017
Debugging via keyboard shortcuts.return array of UIKeyCommand objects, which define a keyboard shortcut.The ViewController will execute corresponding actions mapped to the shortcut.Useful when you want to simulate interactivity but the UI is not ready yet or when you just need to do some debug work.
View DebugWithKeyboard.m
- (BOOL)canBecomeFirstResponder
return YES;
-(NSArray *)keyCommands
return @[
[UIKeyCommand keyCommandWithInput:@"1" modifierFlags:0 action:@selector(debugCommand1)],
[UIKeyCommand keyCommandWithInput:@"2" modifierFlags:0 action:@selector(debugCommand2)]
marcoarment / gist:1105553afba6b4900c10
Created Oct 21, 2014
Variable-height UITableView tableHeaderView with autolayout
View gist:1105553afba6b4900c10
// in a UITableViewController (or any other view controller with a UITableView)
- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIViewControllerTransitionCoordinator>)coordinator
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, size.width, 0)];
header.translatesAutoresizingMaskIntoConstraints = NO;
// [add subviews and their constraints to header]
NSLayoutConstraint *headerWidthConstraint = [NSLayoutConstraint
View AppDelegate.m
static void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
@implementation AppDelegate
View gist:9583748
// UIView+Debug.m
// Symbols
// Created by Khanov on 16/03/14.
// Copyright (c) 2014 Khanov. All rights reserved.
#import "UIView+Debug.h"
zenorocha /
Last active Feb 6, 2020
A template for Github READMEs (Markdown) + Sublime Snippet

Project Name

TODO: Write a project description


TODO: Describe the installation process


You can’t perform that action at this time.