Skip to content

Instantly share code, notes, and snippets.

View plam4u's full-sized avatar
🏠
Working from home

Plamen Andreev plam4u

🏠
Working from home
View GitHub Profile
@rinatkhanov
rinatkhanov / gist:9583748
Created March 16, 2014 14:05
UIView+Debug.m
//
// UIView+Debug.m
// Symbols
//
// Created by Khanov on 16/03/14.
// Copyright (c) 2014 Khanov. All rights reserved.
//
#import "UIView+Debug.h"
@yatatsu
yatatsu / AppDelegate.m
Created June 9, 2014 07:02
ios, debug
#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
@dystonie
dystonie / Asset.m
Created August 20, 2012 12:47
NSLog Debugging
#ifdef DEBUGX
NSLog(@"%s %@", __FUNCTION__, objectToDisplay));
#endif
@danielphillips
danielphillips / DPAnnotationView.h
Last active February 25, 2016 08:48
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.
#import <MapKit/MapKit.h>
@interface DPAnnotationView : MKAnnotationView
@property (nonatomic, assign) MKMapView *mapView;
@end
@plam4u
plam4u / DebugWithKeyboard.m
Last active January 10, 2017 18:32
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.
- (BOOL)canBecomeFirstResponder
{
return YES;
}
-(NSArray *)keyCommands
{
return @[
[UIKeyCommand keyCommandWithInput:@"1" modifierFlags:0 action:@selector(debugCommand1)],
[UIKeyCommand keyCommandWithInput:@"2" modifierFlags:0 action:@selector(debugCommand2)]
@jimrutherford
jimrutherford / UIImage+ImageWithColor.h
Created December 3, 2012 23:49
A simple category on UIImage that will tint a named image with a UIColor
//
// UIImage+ImageWithColor.h
// WordClock
//
// Created by James Rutherford on 2012-12-03.
// Copyright (c) 2012 Braxio Interactive. All rights reserved.
//
@mitchellporter
mitchellporter / README.md
Created May 30, 2019 16:44 — forked from acrookston/README.md
Xcode pre-action to build custom Info.plist

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.

@jayrhynas
jayrhynas / CustomKeyCodable.swift
Last active February 25, 2021 16:23 — forked from IanKeen/CustomKeyCodable.swift
PropertyWrapper: CustomKeyCodable allows defining the keys for decoding _per property_
protocol CustomKeyCodable: Codable {
static var keyEncodingStrategy: ([CodingKey]) -> CodingKey { get }
static var keyDecodingStrategy: ([CodingKey]) -> CodingKey { get }
init()
}
extension CustomKeyCodable {
init(from decoder: Decoder) throws {
self.init()
@kharrison
kharrison / RSSFeed.swift
Last active September 1, 2021 01:59
Swift Decodable With Multiple Custom Dates
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
@ocrampete16
ocrampete16 / pipeline.py
Created March 5, 2019 00:22
A Python implementation of the Pipeline pattern
class Pipeline:
def __init__(self, value):
self.value = value
self.pipes = []
def through(self, pipe):
self.pipes.append(pipe)
def now(self):
for pipe in self.pipes: