Skip to content

Instantly share code, notes, and snippets.

View almas73's full-sized avatar

Almas Daumov almas73

  • San Francisco Bay Area
View GitHub Profile
@almas73
almas73 / gist:e2d5a63da1d7be96bd8f432b74f2d49f
Created September 13, 2018 17:30
How to convert .pdf to .png (keep transparency)
sips -s format png file.pdf --out file.png
import UIKit
import PlaygroundSupport
class MyViewController : UIViewController {
override func loadView() {
let view = UIView()
view.backgroundColor = .white
self.view = view
setupStackView()
}
@interface NSObject (logProperties)
- (void) logProperties;
@end
#import <objc/runtime.h>
@implementation NSObject (logProperties)
- (void) logProperties {
@almas73
almas73 / UIViewCutHole.m
Last active October 26, 2016 18:39
UIView cut hole
- (void)cutHole {
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
CGMutablePathRef path = CGPathCreateMutable();
CGFloat radius = self.holeView.frame.size.height / 2;
CGFloat x = self.holeView.frame.size.width / 2;
CGFloat y = self.holeView.frame.size.height / 2;
CGPathAddArc(path, nil, x, y, radius, 0.0, 2 * 3.14, false);
CGPathAddRect(path, nil, CGRectMake(0, 0, self.holeView.frame.size.width, self.holeView.frame.size.height));