Skip to content

Instantly share code, notes, and snippets.

@SpacyRicochet
SpacyRicochet / lavarules.mermaid
Last active August 26, 2022 13:25
Fire and Brimstone: a comprehensive guide to lava, magma and superheated rock
View lavarules.mermaid
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SpacyRicochet
SpacyRicochet / Money.swift
Last active February 9, 2019 12:13
Extension of protocol cannot have inheritance clause
View Money.swift
protocol Money {
var value: Double { get }
var inGold: Double { get }
var symbol: String { get }
}
// Sadly, gives a compiler error.
// "Extension of protocol 'Money' cannot have an inheritance clause"
extension Money: CustomStringConvertible {
var description: String {
@SpacyRicochet
SpacyRicochet / README.md
Created July 19, 2018 15:10
Creating an app – Things to keep in mind
View README.md
  • How does your app access its data?
    • How do you make sure your components have access to the data they need?
    • What manages the data?
  • How does your screen show that it's loading something? (e.g. from the internet)
    • How does your screen show that the loading failed?
  • How does your screen show a modal explanation of something? (e.g. tutorial, alert dialog)
  • How does a user fill in information?
    • How do you validate that information?
    • How is the user shown that certain input is wrong/didn't pass validation?
  • How does the onboarding show?
@SpacyRicochet
SpacyRicochet / drtc_wishlist
Last active April 9, 2017 19:21
Death Road to Canada wishlist
View drtc_wishlist
* Some setting to allow always randomizing your starting leader and buddy.
* Being able to share custom characters somehow. Would be great download some that other people made.
* Some extra exploration; would love some random, non-useful gags to discover in certain locations.
@SpacyRicochet
SpacyRicochet / Playgrounds.swift
Created January 29, 2017 19:17
Snippet of the Week; Prototyping views in Playgrounds
View Playgrounds.swift
import UIKit
import PlaygroundSupport
//: NSLayoutConstraint convenience methods
public extension NSLayoutConstraint {
public static func pinning(attribute: NSLayoutAttribute, ofView firstView: UIView, toView secondView: UIView, multiplier: CGFloat = 1, offset: CGFloat = 0) -> NSLayoutConstraint {
return NSLayoutConstraint(item: firstView, attribute: attribute, relatedBy: .equal, toItem: secondView, attribute: attribute, multiplier: multiplier, constant: offset)
}
@SpacyRicochet
SpacyRicochet / Playgrounds.swift
Created February 5, 2017 20:22
Snippet of the Week: Lighter and Darker Colors
View Playgrounds.swift
import UIKit
import PlaygroundSupport
public extension UIColor {
public func hsba() -> (hue: CGFloat, saturation: CGFloat, brightness: CGFloat, alpha: CGFloat)? {
var hue: CGFloat = .nan, saturation: CGFloat = .nan, brightness: CGFloat = .nan, alpha: CGFloat = .nan
guard self.getHue(&hue, saturation: &saturation, brightness: &brightness, alpha: &alpha) else {
return nil
}
return (hue: hue, saturation: saturation, brightness: brightness, alpha: alpha)
@SpacyRicochet
SpacyRicochet / feedme_pp_en.markdown
Created February 6, 2017 13:33
Feed Me Privacy Policy
View feedme_pp_en.markdown

Feed me

Feed Me is a simple application that allows you to keep track of your child's nutrition, sleep, diapers and medicine-use.

Below we outline our Privacy Policy.

Privacy Policy

Feed Me keeps all of your personal data in your own hands. We have no way of accessing your data.

@SpacyRicochet
SpacyRicochet / Pages2PDF.script
Created January 20, 2017 18:21
Apple Script that _should_ export all selected .pages documents to PDF. Doesn't work due to Sandboxing.
View Pages2PDF.script
on run {input, parameters}
repeat with _document in input
tell application "Finder"
set _directory to get container of file _document
set _documentName to name of _document
if _documentName ends with ".pages" then ¬
set _documentName to text 1 thru -7 of _documentName
@SpacyRicochet
SpacyRicochet / gist:addeae7601de1ba54e19de440cc2db0b
Created October 10, 2016 08:42
Using lanes to update POEditor strings
View gist:addeae7601de1ba54e19de440cc2db0b
desc "Downloads the latest apple_strings and updates the project with them."
lane :"update_strings" do
puts "Updating English."
update_language(lang: 'en', base: true)
puts "Updating French."
update_language(lang: 'fr')
puts "Updating German."
update_language(lang: 'de')
end
@SpacyRicochet
SpacyRicochet / instructions.markdown
Created September 21, 2016 06:06
How to make a bootable macOS Sierra installer drive
View instructions.markdown
  1. Follow the instructions on this iMore tutorial
  2. EXCEPT when you have to enter the terminal command, use the following command instead;

sudo /Applications/Install\ macOS\ Sierra.app/Contents/Resources/createinstallmedia --volume /Volumes/elcap --applicationpath /Applications/Install\ macOS\ Sierra.app --nointeraction