This file contains 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
/* | |
Copyright (c) 2009 Remy Demarest | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following |
This file contains 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
$fs=1; | |
$fa=1; | |
servo_l = 24; | |
servo_w = 13; | |
servo_h = 21; | |
bolt_hole_diameter = 4.5; | |
servo_axis_diameter = 4; |
This file contains 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
0 | |
0 1.5 | |
0 0.5 | |
0.2 0.1 | |
0.5 0 | |
0.8 0.1 | |
1 0.5 | |
1 1.5 | |
0.8 1.9 | |
0.5 2 |
This file contains 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 <Foundation/Foundation.h> | |
NSString *testString = @"00:01:07,400-234-090\n00:05:01,701-080-080\n00:05:00,400-234-090"; | |
NSTimeInterval durationToSeconds(NSString *duration) | |
{ | |
NSDateFormatter *df = [NSDateFormatter new]; | |
df.dateFormat = @"hh:mm:ss"; |
This file contains 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 PulsatingButtonViewController: UIViewController { | |
private var button: UIButton? | |
private var timer: Timer? | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.button = UIButton(frame: CGRect(x: 250, y: 250, width: 100, height: 50)) | |
if let button = self.button { |
This file contains 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
let button = UIButton(frame: CGRect(x: 75, y: 75, width: 100, height: 50)) | |
button.backgroundColor = UIColor.green | |
button.setTitle("Boom Boom", for: .normal) | |
button.titleLabel?.textColor = UIColor.black | |
let view = UIView(frame: CGRect(x: 0, y: 0, width: 300, height: 300)) | |
PlaygroundPage.current.liveView = view | |
view.addSubview(button) |
This file contains 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 PulsateViewAnimator: NSObject { | |
private weak var view: UIView? | |
private var timer: Timer? | |
private let breathOutDuration: TimeInterval | |
private let holdDuration: TimeInterval | |
private let breathInDuration: TimeInterval | |
private let pulseScaleIdentity: CGAffineTransform |
This file contains 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
let count = 15 | |
let center = CGPoint(x: view.frame.width/2, y:view.frame.height/2) | |
button.center = center | |
let radius : CGFloat = 100 | |
var angle = CGFloat(2 * M_PI) | |
for i in 1...count { | |
let x = cos(angle) * radius + center.x |
This file contains 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
struct TypeOneStruct { | |
let foo1: Int | |
let foo2: Int | |
let bar1: Bool | |
} | |
struct TypeTwoStruct { | |
let fooString: String | |
let barBool: Bool | |
let foo1: Int |
OlderNewer