Skip to content

Instantly share code, notes, and snippets.

View mkuliszkiewicz's full-sized avatar
👋

Maciej Kuliszkiewicz mkuliszkiewicz

👋
View GitHub Profile
@mkuliszkiewicz
mkuliszkiewicz / README.md
Created November 25, 2023 11:06 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@mkuliszkiewicz
mkuliszkiewicz / aoc_day14.swift
Last active December 14, 2022 19:42
AoC Day 14
struct Point: Hashable, CustomStringConvertible {
let x: Int; let y: Int
init(x: Int, y: Int) {
self.x = x
self.y = y
}
init(_ str: String) {
// x represents distance to the right and y represents distance down.
@mkuliszkiewicz
mkuliszkiewicz / task1.swift
Last active December 13, 2022 20:23
AoC Day 12 Task 2
class Path {
let point: Point
let previousPath: Path?
let length: Int
init(to point: Point, previousPath path: Path? = nil) {
self.point = point
self.length = 1 + (path?.length ?? 0)
self.previousPath = path
}
@mkuliszkiewicz
mkuliszkiewicz / CarrierObserver.h
Last active September 4, 2018 20:11
CTTelephonyNetworkInfo
#import <CoreTelephony/CTCarrier.h>
#import <CoreTelephony/CTTelephonyNetworkInfo.h>
@class CTCarrier;
@interface ANCarrierMeta: NSObject
@property (nonatomic, copy, readonly) NSString *name;
@property (nonatomic, copy, readonly) NSString *countryCode;
@property (nonatomic, copy, readonly) NSString *networkCode;
- (instancetype)initWith:(NSString *)name
@mkuliszkiewicz
mkuliszkiewicz / SPVMainViewController.m
Created December 12, 2017 15:12 — forked from jazzychad/SPVMainViewController.m
example of transferring velocity of UIPanGestureRecoginizer to a UIView spring animation.
#import "SPVMainViewController.h"
@implementation SPVMainViewController
{
UIView *_weightView;
UIPanGestureRecognizer *_recog;
}
- (void)viewDidLoad
{
@mkuliszkiewicz
mkuliszkiewicz / DynamicAnimatorExtensions.swift
Created December 12, 2017 13:46
UIDynamicAnimator debugging extension
extension UIDynamicAnimator {
func _setDebugAnimationSpeed(_ speed: CGFloat) {
self.perform(NSSelectorFromString("setDebugAnimationSpeed:"), with: speed)
}
func _setDebugEnabled(_ enabled: Bool) {
self.perform(NSSelectorFromString("setDebugEnabled:"), with: enabled)
}
func _setDebugFrameInterval(_ interval: Int) {
func p_setupTextLayer(text: String) -> CAShapeLayer {
var letters = CGPathCreateMutable()
let font = CTFontCreateWithName("Helvetica-Bold", 72, nil)
let attrs = [kCTFontAttributeName: font]
var attrString = NSAttributedString(string: text, attributes: attrs)
let line = CTLineCreateWithAttributedString(attrString)
let runArray = CTLineGetGlyphRuns(line)
@mkuliszkiewicz
mkuliszkiewicz / EpsCompare.swift
Last active March 6, 2017 20:42
Compare 2 CGFloats
extension CGFloat {
static var eps: CGFloat {
if CGFLOAT_IS_DOUBLE == 1 {
return CGFloat(DBL_EPSILON)
} else {
return CGFloat(FLT_EPSILON)
}
}
}
#import <objc/runtime.h>
void DumpObjcMethods(Class clz) {
unsigned int count = 0;
Method *methods = class_copyMethodList(clz, &count);
printf("Found %d methods on '%s'\n", count, class_getName(clz));
for (unsigned int i = 0; i < count; i++) {
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation