Skip to content

Instantly share code, notes, and snippets.

View thecoolwinter's full-sized avatar

Khan Winter thecoolwinter

View GitHub Profile
@thecoolwinter
thecoolwinter / hide_desktop.sh
Created May 20, 2021 18:35
Quickly toggle your desktop icons with a simple script. Can also be used in an Automator script as an application.
#!/usr/bin/env zsh
previous_val=$(defaults read com.apple.finder CreateDesktop)
if [ "$previous_val" = "true" ]
then
previous_val=$(echo 'false');
else
previous_val=$(echo 'true')
fi
@thecoolwinter
thecoolwinter / ExtraCodable.swift
Created March 16, 2021 21:28
Helper methods for working with Codable objects and JSON Data and dictionaries. Provides two initializers and two methods for creating a Codable object using a dictionary or a Data object. And two methods for retreiving a dictionary or Data from the Codable instance.
//
// ExtraCodable.swift
//
// Created by Khan Winter on 3/16/21.
// Copyright © 2021 WindChillMedia. All rights reserved.
//
// 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
import Foundation
public class CodableStorage {
fileprivate init() { }
enum Directory {
case documents
case caches
case shared // Use for sharing files between containers. Eg, with an app extension.
@zacwest
zacwest / ios-font-sizes.swift
Last active June 17, 2024 01:38
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]