- Go to System Preferences -> Keyboard -> Modifier Keys...
- Change “Caps Lock” to “No action”
- Install Seil
- Change the Caps Lock key in Seil to keyCode 80 (F19)
- Install Karabiner
- Open Karabiner and go to Misc & Uninstall -> Open private.xml
- Copy the contents of this gist's example to the XML file and save
- In Karabiner, go to Change Keys -> Reload XML
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
// | |
// ContentView.swift | |
// WindowExample | |
// | |
// Created by Daniel Eden on 29/01/2024. | |
// | |
import SwiftUI | |
struct ContentView: View { |
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
/** | |
*/ | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
position: relative; | |
} |
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
/* Stacking context demo */ | |
* { | |
margin: 0; | |
padding: 0; | |
-webkit-box-sizing: border-box; | |
-moz-box-sizing: border-box; | |
box-sizing: border-box; | |
} | |
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
// | |
// Color.extension.swift | |
// Zeitgeist | |
// | |
// Created by Daniel Eden on 30/12/2020. | |
// Copyright © 2020 Daniel Eden. All rights reserved. | |
// | |
import Foundation | |
import SwiftUI |
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
struct Fields { | |
var userFields: Set<User.Fields>? | |
var tweetFields: Set<Tweet.Fields>? | |
} | |
protocol Fetcher { | |
// Is there a way to do something like this, where I can specify that the `Fields` | |
// struct must contain only these member types? | |
func getTweet(fields: Fields<Tweet.Fields, User.Fields>? = nil) async -> Tweet | |
func getUser(fields: Fields<User.Fields>? = nil) async -> User |
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
struct User: Codable, Identifiable { | |
typealias ID = String | |
let id: ID | |
let name: String | |
let username: String | |
// Assume that items can be optionally set in getUser | |
var items: UserItems? | |
} |
I’m trying to decode two slightly different JSON API responses to the same Codable type, Account
. Mapping userResponse.json
’s uid
to id
is trivial, but extracting the nested user
is stumping me.
Any suggestions would be greatly appreciated!
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
/* <i> Cloud */ | |
html { | |
min-height: 100%; | |
background: linear-gradient(#b4bcbf, #fff); | |
} | |
.cloud { | |
display: inline-block; | |
background-color: #fff; |
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
import SwiftUI | |
import Combine | |
struct HMS { | |
var h: Int | |
var m: Int | |
var s: Int | |
} | |
struct ContentView: View { |
NewerOlder