Skip to content

Instantly share code, notes, and snippets.

View nikolaykasyanov's full-sized avatar

Nikolai Kasyanov nikolaykasyanov

View GitHub Profile
@j3j5
j3j5 / gist:8b3e48ccad746b90a54a
Last active August 12, 2025 13:40
Adyen Test Card Numbers
Adyen Test Card Numbers
These cards are only valid on our TEST system and they will never involve any actual transaction or transfer of funds. The TEST card numbers will not work on the Adyen LIVE Platform.
For all cards use the following expiration and CVV2/CVC2/or CID for Amex.
For all cards:
Expiration Dates CVV2 / CVC3 CID (American Express)
08/2018 OR 10/2020 737 7373
@steipete
steipete / NullabilityMacros.h
Created February 25, 2015 23:22
Want nullability right away? This will degrade gracefully until you can drop Xcode 6.1/Xcode 6.2.
// Xcode 6.3 defines new language features to declare nullability
#if __has_feature(nullability)
#define PSPDF_ASSUME_NONNULL_BEGIN _Pragma("clang assume_nonnull begin")
#define PSPDF_ASSUME_NONNULL_END _Pragma("clang assume_nonnull end")
#define ps_nullable nullable
#define ps_nonnull nonnull
#define ps_null_unspecified null_unspecified
#define ps_null_resettable null_resettable
#define __ps_nullable __nullable
#define __ps_nonnull __nonnull
anonymous
anonymous / NSStringVariations.m
Created February 18, 2015 08:32
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
void (^benchmark)(const char *str) = ^(const char *str) {
const long count = 10000000;
NSDate *start = [NSDate date];
for (long i = 0; i < count; i++) {
(void)[[NSString alloc] initWithUTF8String:str];
}
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active June 7, 2026 09:24
The best FRP iOS resources.

Videos

@interface PSPDFWindow ()
@property (nonatomic, strong) UIViewController *realRootViewController;
@end
@implementation PSPDFWindow
- (void)setHidden:(BOOL)hidden {
[super setHidden:hidden];
// Workaround for rdar://19592583
@airspeedswift
airspeedswift / COWTree.swift
Last active March 5, 2017 13:20
Swift copy-on-write behaviour for a struct using HeapBuffer
// ideally we would define this inside the tree struct
private class _Node<T: Comparable> {
var _value: T
var _left: _Node<T>? = nil
var _right: _Node<T>? = nil
init(value: T) { _value = value }
}
@cdzombak
cdzombak / tgmath.md
Last active July 14, 2016 18:01
fucking tgmath doesn't work with ObjC modules, and Apple has known about this for at least a year and doesn't care about fixing it
@steipete
steipete / gist:20d04053344b3cb36056
Created November 29, 2014 19:19
Quite a lot of calls happening for a simple modal view controller presentation.
-> <ViewController:0x79634cd0>: -[UIViewController presentViewController:<NavigationController: 0x7ba7dab0> animated:1 completion:(null)]
--> <ViewController:0x79634cd0>: -[UIViewController _transitionCoordinator]
---> <ViewController:0x79634cd0>: -[UIViewController _presentationController]
===> (null)
---> <ViewController:0x79634cd0>: -[UIViewController presentedViewController]
----> <ViewController:0x79634cd0>: -[UIViewController childModalViewController]
====> (null)
===> (null)
---> <ViewController:0x79634cd0>: -[UIViewController childModalViewController]
===> (null)
@mattt
mattt / nshipster-new-years-2015.md
Created November 25, 2014 19:38
NSHipster New Year's 2015

Season's Greetings, NSHipsters!

As the year winds down, and we take a moment to reflect on our experiences over the past months, one thing is clear: 2014 has been an incredible year professionally for Apple developers. So much has happened in such a short timespan, and yet it's hard to remember our relationship to Objective-C before Swift, or what APIs could have captivated our imagination as much as iOS 8 or WatchKit.

It's an NSHipster tradition to ask you, dear readers, to send in your favorite tips and tricks from the past year for publication over the New Year's holiday. This year, with the deluge of new developments—both from Cupertino and the community at large—there should be no shortage of interesting tidbits to share.

Submit your favorite piece of Swift or Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!

If you're wondering about what to post, look to

@jaredru
jaredru / RACSignal+ShareWhileActiveBackport.m
Last active June 30, 2017 02:09
A ReactiveCocoa 2.x `-shareWhileActive` backport
- (RACSignal *)shareWhileActive {
NSRecursiveLock *lock = [[NSRecursiveLock alloc] init];
lock.name = @"com.github.ReactiveCocoa.shareWhileActive";
// These should only be used while `lock` is held.
__block NSUInteger subscriberCount = 0;
__block RACDisposable *underlyingDisposable = nil;
__block RACReplaySubject *inflightSubscription = nil;
return [[RACSignal