Skip to content

Instantly share code, notes, and snippets.

View greggjaskiewicz's full-sized avatar
:shipit:
🦸🏼‍♂️

greg jaskiewicz greggjaskiewicz

:shipit:
🦸🏼‍♂️
View GitHub Profile
/*
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
@greggjaskiewicz
greggjaskiewicz / clock.scad
Last active August 29, 2015 14:25 — forked from m-ou-se/clock.scad
3D model for my whiteboard clock
$fs=1;
$fa=1;
servo_l = 24;
servo_w = 13;
servo_h = 21;
bolt_hole_diameter = 4.5;
servo_axis_diameter = 4;
@greggjaskiewicz
greggjaskiewicz / font
Last active August 29, 2015 14:25 — forked from m-ou-se/font
Font for my whiteboard clock
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
#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";
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 {
final class PulsatingButton: UIButton {
   private var timer: Timer?
   func setup() {
       self.layer.shouldRasterize = true
       self.timer = Timer.scheduledTimer(timeInterval: 5.0, target: self, selector: #selector(timerAction), userInfo: nil, repeats: true)
   }
   private let buttonScaleIdentity = CGAffineTransform.init(scaleX: 1.75, y: 1.75)
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)
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
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
@greggjaskiewicz
greggjaskiewicz / twoStructs.swift
Created May 1, 2017 14:38
two structs_associated_types
struct TypeOneStruct {
    let foo1: Int
    let foo2: Int
    let bar1: Bool
}
struct TypeTwoStruct {
    let fooString: String
    let barBool: Bool
    let foo1: Int