Skip to content

Instantly share code, notes, and snippets.

View bgayman's full-sized avatar

Brad Gayman bgayman

View GitHub Profile
$ cd /
$ ls
dir cmwrq
dir ftrccld
dir jjlbmtw
dir jpncfpb
dir mddr
dir mthvntdd
55644 pjts.dzh
dir ptzsl
@bgayman
bgayman / TapWord
Last active January 27, 2018 15:12
import UIKit
import PlaygroundSupport
class ViewController: UIViewController {
var notesTextView: UITextView!
override func viewDidLoad() {
super.viewDidLoad()
notesTextView = UITextView(frame: CGRect(x: 0, y: 0, width: 100, height: 100))
view.addSubview(notesTextView)
import UIKit
import PlaygroundSupport
final class ViewController: UITableViewController {
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(TableViewCell.self, forCellReuseIdentifier: "\(TableViewCell.self)")
}
//
// ObjcViewController.m
// FilterCam
//
// Created by B Gay on 11/3/17.
// Copyright © 2017 B Gay. All rights reserved.
//
#import "ObjcViewController.h"
#import <AVFoundation/AVFoundation.h>
@bgayman
bgayman / FilterCam.swift
Last active September 25, 2022 00:42
Setup AVCaptureSession with CIFilter
//
// ViewController.swift
// CameraFilter
//
import UIKit
import AVFoundation
class ViewController: UIViewController, AVCaptureVideoDataOutputSampleBufferDelegate {
import UIKit
class SpringyCollectionViewFlowLayout: UICollectionViewFlowLayout
{
lazy var dynamicAnimator: UIDynamicAnimator =
{
return UIDynamicAnimator(collectionViewLayout: self)
}()
var visibleIndexPathsSet = Set<IndexPath>()
import UIKit
import PlaygroundSupport
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource
{
let tableView = UITableView(frame: CGRect.zero, style: .plain)
let containerView = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300))
var text = ["dog 🐶", "cat 🐱", "mouse 🐭", "bird 🐦", "rat 🐀", "chicken 🐔"]
import UIKit
import PlaygroundSupport
extension UIView
{
var snapshot: UIImage?
{
UIGraphicsBeginImageContextWithOptions(self.bounds.size, false, 0)
self.drawHierarchy(in: self.bounds, afterScreenUpdates: true)
let image = UIGraphicsGetImageFromCurrentImageContext()
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface KerningLabel : UILabel
@property (nonatomic) IBInspectable CGFloat kerning;
@end