Skip to content

Instantly share code, notes, and snippets.

View mkuliszkiewicz's full-sized avatar
🚴

Maciej Kuliszkiewicz mkuliszkiewicz

🚴
  • Kraków / Stockholm
View GitHub Profile
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 / 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) {
@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 / 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 / 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 / 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 / README.md
Created November 25, 2023 11:06 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.