Skip to content

Instantly share code, notes, and snippets.

View richy486's full-sized avatar
🐶
Experimenting

Richard Adem richy486

🐶
Experimenting
View GitHub Profile
simulator OS log
$ tail -f ~/Library/Logs/CoreSimulator/<DEVICE_CODE>/system.log
The DEVICE_CODE value can be found via the following console command:
$ instruments -s devices
-- Visual effects --
current view zooms out when modal appears
https://github.com/kentnguyen/KNSemiModalViewController
image moved to center while view fades out
https://github.com/michaelhenry/MHFacebookImageViewer
-- Networking --
@richy486
richy486 / UIView+ConstraintsHelper.swift
Last active September 5, 2016 18:20
UIView+ConstraintsHelper.swift
//
// UIView+ConstraintsHelper.swift
//
// Created by Richard Adem on 5/17/16.
// Copyright © 2016 Richard Adem. All rights reserved.
//
import UIKit
struct VFLManager {
I found a few examples over the internet, enjoy:
http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
http://devimages.apple.com/iphone/samples/bipbop/bipbopall.m3u8
http://devimages.apple.com/iphone/samples/bipbop/gear1/prog_index.m3u8
http://playertest.longtailvideo.com/adaptive/oceans_aes/oceans_aes.m3u8 (AES encrypted)
http://playertest.longtailvideo.com/adaptive/captions/playlist.m3u8 (HLS stream with CEA-608 captions)
http://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8 (with metadata)
http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8
http://cdn-fms.rbs.com.br/hls-vod/sample1_1500kbps.f4v.m3u8
IK for sprite kit:
https://www.raywenderlich.com/129895/sprite-kit-inverse-kinematics-swift-2
//
// NibLoader.swift
//
// Created by Richard Adem on 5/26/16.
// Copyright © 2016 Richard Adem. All rights reserved.
//
// Modified from
// https://github.com/karthikprabhuA/CustomXIBSwift
//
@richy486
richy486 / CGHelpers.swift
Last active September 18, 2018 15:10
Operator overloads for Core Graphics data structures
//
// CGHelpers.swift
//
// Created by Richard Adem on 6/21/16.
// Copyright © 2016 Richard Adem. All rights reserved.
//
// Lerp and Clamp from Daniel Clelland https://github.com/dclelland/Lerp
import CoreGraphics
// vector to radians
let radian = atan2(vector.y, vector.x)
// difference between two vectors
let difference = CGFloat.pi2 - abs(abs(radian1 - radian2) - CGFloat.pi2)