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
@simme
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
ryuichis / gist:755e6297aec13c900cdf
Last active Mar 12, 2019 — forked from gavrix/gist:5054182
Script integrating OCLint into XCode. Put it in "Run script" build phase.
View gist:755e6297aec13c900cdf
source ~/.bash_profile
cd ${SRCROOT}
xcodebuild clean
xcodebuild | xcpretty -r json-compilation-database
oclint-json-compilation-database -- -report-type xcode
@plam4u
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
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
#if DEBUG
// http://www.zero4racer.com/blog/480
static void uncaughtExceptionHandler(NSException *exception) {
NSLog(@"CRASH: %@", exception);
NSLog(@"Stack Trace: %@", [exception callStackSymbols]);
// Internal error reporting
}
#endif
@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
zenorocha / README.md
Last active Aug 16, 2019
A template for Github READMEs (Markdown) + Sublime Snippet
View README.md

Project Name

TODO: Write a project description

Installation

TODO: Describe the installation process

Usage

@jimrutherford
jimrutherford / UIImage+ImageWithColor.h
Created Dec 3, 2012
A simple category on UIImage that will tint a named image with a UIColor
View UIImage+ImageWithColor.h
//
// UIImage+ImageWithColor.h
// WordClock
//
// Created by James Rutherford on 2012-12-03.
// Copyright (c) 2012 Braxio Interactive. All rights reserved.
//
@danielphillips
danielphillips / DPAnnotationView.h
Last active Feb 25, 2016
MKAnnotationView subclass to implement lift and drop animations for your custom map pin. Use this in exactly the same was as MKPinAnnotationView or use the implementation in conjunction with your existing MKAnnotationView subclass.
View DPAnnotationView.h
#import <MapKit/MapKit.h>
@interface DPAnnotationView : MKAnnotationView
@property (nonatomic, assign) MKMapView *mapView;
@end
@dystonie
dystonie / Asset.m
Created Aug 20, 2012
NSLog Debugging
View Asset.m
#ifdef DEBUGX
NSLog(@"%s %@", __FUNCTION__, objectToDisplay));
#endif
You can’t perform that action at this time.