$ brew install imagemagick
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // A 30-minute hack to recreate the "iBeer" effect using SpriteKit, SwiftUI, and metaballs. | |
| // The effect is created by having hundreds of physics-enabled balls in a SpriteKit scene, | |
| // all drawing nothing. These balls are then read back out by SwiftUI in a TimelineView, and | |
| // drawn using blur and alpha threshold filters to make them appear to be a liquid. | |
| // The SpriteKit scene then has its gravity changed dynamically using the accelerometer, | |
| // meaning that the "liquid" splashes around as you tilt your phone. | |
| // | |
| // Created by Paul Hudson | |
| // https://www.hackingwithswift.com/license |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import AVFoundation | |
| class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
| let tableView = UITableView(frame: .zero, style: .plain) | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| tableView.register(PlayerTableViewCell.self, forCellReuseIdentifier: "PlayerCell") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
| <plist version="1.0"> | |
| <dict> | |
| <key>UnifiedBar</key> | |
| <dict> | |
| <key>DisclosureRequired</key> | |
| <string>ace440ac-b4f6-4b43-aade-02bba1589aef</string> | |
| <key>Enabled</key> | |
| <false/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| final class SingleItemCarouselFlowLayout: UICollectionViewFlowLayout { | |
| override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint { | |
| guard let collectionView = collectionView else { | |
| return super.targetContentOffset(forProposedContentOffset: proposedContentOffset, withScrollingVelocity: velocity) | |
| } | |
| var offsetAdjustment: CGFloat = .greatestFiniteMagnitude |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Created by Sean Heber on 9/26/19. | |
| @import UIKit; | |
| @interface KeyboardAwareContainerView : UIView | |
| @property (nonatomic, readonly, nonnull) UIView *contentView; | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| addmedia | |
| addphoto | |
| addvideo | |
| appinfo | |
| boot | |
| bootstatus | |
| clone | |
| create | |
| darwinup | |
| delete |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/swift sh | |
| import Foundation | |
| import PromiseKit // @mxcl ~> 6.5 | |
| import Swifter // @mattdonnelly == b27a89 | |
| let swifter = Swifter( | |
| consumerKey: "FILL", | |
| consumerSecret: "ME", | |
| oauthToken: "IN", | |
| oauthTokenSecret: "https://developer.twitter.com/en/docs/basics/apps/overview.html" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension UIView { | |
| @objc func exerciseAmbiguityInLayoutRepeatedly() { | |
| if self.hasAmbiguousLayout { | |
| Timer.scheduledTimer(timeInterval: 0.5, | |
| target: self, | |
| selector: #selector(UIView.exerciseAmbiguityInLayout), | |
| userInfo: nil, | |
| repeats: true) | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Time to decode 10,000 Person struct's from JSON: | |
| Argo (Simple): 8.563 seconds | |
| measureBlock { | |
| let _ : [Person]? = decode(data) | |
| } | |
| Argo (Decomp'd): 3.344 | |
| measureBlock { | |
| let json: Argo.JSON = JSON.parse(data) |
NewerOlder