Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing, always!

Paul Peelen ppeelen

🎯
Focusing, always!
View GitHub Profile
View RoundedAnnulusSector.swift
import UIKit
import PlaygroundSupport
class ArcView: UIView {
private var strokeWidth: CGFloat {
return CGFloat(min(self.bounds.width, self.bounds.height) * 0.25)
}
override open func draw(_ rect: CGRect) {
super.draw(rect)
@westerlund
westerlund / FontSizesHelper.swift
Last active Jul 17, 2022
I made a really simple helper for using Dynamic Type with your own fonts
View FontSizesHelper.swift
struct FontSizesHelper {
static func dynamicSize(for originalSize: CGFloat, category: UIContentSizeCategory = UIApplication.shared.preferredContentSizeCategory) -> CGFloat {
let modifyBy: CGFloat = {
switch category {
case .extraSmall: return -3
case .small: return -2
case .medium: return -1
case .large: return 0
case .extraLarge: return 2
case .extraExtraLarge: return 4
@dduan
dduan / XCTest+Eventually.swift
Last active Jan 11, 2023
A simple "eventually" method to aide asynchronous testing with XCTest
View XCTest+Eventually.swift
import XCTest
extension XCTestCase {
/// Simple helper for asynchronous testing.
/// Usage in XCTestCase method:
/// func testSomething() {
/// doAsyncThings()
/// eventually {
/// /* XCTAssert goes here... */
@jakebellacera
jakebellacera / how-to-install-php-development-environment-on-osx.md
Last active Aug 24, 2018
How to install a basic Apache, PHP and MySQL development environment with Homebrew. Mirrored from the Echo & Co. blog.
View how-to-install-php-development-environment-on-osx.md

How to install a basic Apache, PHP and MySQL development environment with Homebrew

This guide will walk you through the steps required to install a basic Apache, PHP and MySQL development environment using homebrew. Basically, all you'll need to do is copy the commands below into Terminal. Copy one block at a time.

NOTE: this guide is mirrored from Echo & Co.'s blog in case the original blog post or the website decides to go down. I've shared this guide around many times to colleagues and friends. Please give Alan Ivey (@alanthing) all of the credit for publishing this really helpful guide.

Before we begin...

We're going to need to install homebrew, a super awesome package manager for OS X. Installation instructions are available on the homebrew website.

@lttlrck
lttlrck / gist:9628955
Created Mar 18, 2014
rename git branch locally and remotely
View gist:9628955
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@adamawolf
adamawolf / Apple_mobile_device_types.txt
Last active Jan 26, 2023
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
View Apple_mobile_device_types.txt
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S