Table of Contents
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
func progression(from: Double, to: Double, numberOfItems: Int) -> [Double] { | |
let delta = (to - from) / Double(numberOfItems) | |
var results: [Double] = [] | |
for _ in 0..<numberOfItems { | |
let lastItem = results.last ?? from | |
let numberToAppend = lastItem + delta |
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
var prettyVersionNumber: String { | |
get { | |
if let infoDictionary = Bundle.main.infoDictionary { | |
if let versionNumber = infoDictionary["CFBundleShortVersionString"] as? String, | |
let buildNumber = infoDictionary["CFBundleVersion"] as? String { | |
return "\(versionNumber) (\(buildNumber))" | |
} | |
} | |
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
// | |
// UIApplication+isRunningOnSimulator.swift | |
// MusicMind | |
// | |
// Created by Wesley Van der Klomp on 5/11/17. | |
// https://gist.github.com/wvdk/e3dd57620c53f338978e6d5d022d3672 | |
// Thanks to http://stackoverflow.com/a/30284266/6407050 | |
// | |
import Foundation |
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
// | |
// Created by wvdk on 2/10/17. | |
// Copyright © 2017 Wesley Van der Klomp. All rights reserved. | |
// | |
// https://gist.github.com/wvdk/46dbc3b88a0924e5815e7e68933e31ec | |
// | |
// For macOS | |
// | |
import Foundation |
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
// | |
// Created by WVDK on 2/10/17. | |
// Copyright © 2017 Wesley Van der Klomp. All rights reserved. | |
// | |
// https://gist.github.com/wvdk/e8992e82b04e626a862dbb991e4cbe9c | |
// | |
import UIKit | |
extension UILabel { |
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
# export PS1="úÙ¯‘ \[\033[38m\]\h\[\033[01;34m\] \w \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.match(/^\*.*/).to_s || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[37m\]$\[\033[00m\] " | |
#alias ls='ls -a -l -G -h -p -T' | |
alias ls='ls -A -h -p' | |
alias gs='git status ' | |
alias ga='git add ' | |
alias gb='git branch ' | |
alias gc='git commit -m' |