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
# setup | |
# pip install cryptography pyjwt | |
# ref. | |
# http://gobiko.com/blog/token-based-authentication-http2-example-apns/ | |
import jwt | |
import time | |
ALGORITHM = 'ES256' |
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
// | |
// SamView.swift | |
// CloudKit-UI-test | |
// | |
// Created by Jordi Bruin on 03/07/2020. | |
// Copyright © 2020 Good Snooze. All rights reserved. | |
// | |
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 ReviewTabView: View { | |
var reviews: [Review] = [ | |
Review(title: "Great app", reviewer: "Maartje Derks", text: "This app really makes my life so much easier. Can't wait to use it."), | |
Review(title: "Great app", reviewer: "Maartje Derks", text: "This app really makes my life so much easier. Can't wait to use it."), | |
Review(title: "Great app", reviewer: "Maartje Derks", text: "This app really makes my life so much easier. Can't wait to use it."), | |
Review(title: "Great app", reviewer: "Maartje Derks", text: "This app really makes my life so much easier. Can't wait to use it."), | |
] | |
@State var selectedIndex = 0 | |
@State var timer = Timer.publish(every: 4, on: .main, in: .common).autoconnect() |
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 | |
// constraint test | |
// | |
// Created by Jordi Bruin on 01/04/2021. | |
// | |
import SwiftUI | |
// 1. Click the "Open Detail View" button |
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
enum ThemeMode: CaseIterable { | |
case light | |
case dark | |
case system | |
var text: String { | |
switch self { | |
case .light: | |
return "Light" | |
case .dark: |
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
class FloatingPanel: NSPanel { | |
init(contentRect: NSRect, backing: NSWindow.BackingStoreType, defer flag: Bool) { | |
// Not sure if .titled does affect anything here. Kept it because I think it might help with accessibility but I did not test that. | |
super.init(contentRect: contentRect, styleMask: [.nonactivatingPanel, .resizable, .closable, .fullSizeContentView], backing: backing, defer: flag) | |
// Set this if you want the panel to remember its size/position | |
// self.setFrameAutosaveName("a unique name") | |
// Allow the pannel to be on top of almost all other windows |
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
JSON: | |
https://unpkg.com/[email protected]/emoji.json | |
class EmojiManager: ObservableObject { | |
@Published var emojis: [EmojiObject] = [] | |
init() { | |
decodeJSON() |
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
/* CGSPrivate.h -- Header file for undocumented CoreGraphics stuff. */ | |
/* This file is a relicensed portion of DesktopManager and was originally released under | |
* the terms of the GNU General Public Licence. Original licence text follows the new terms. | |
* The contents of this file has been re-released by the original author under the following terms: | |
* | |
* Copyright (C) 2003, 2004, 2013 Richard J Wareham <[email protected]> | |
* | |
* 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 |
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 | |
// BookCover | |
// | |
// Created by Jordi Bruin on 01/07/2022. | |
// | |
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
import SwiftUI | |
@main | |
struct MenuBarApp: App { | |
@NSApplicationDelegateAdaptor(StatusBarDelegate.self) var appDelegate | |
var body: some Scene { | |
WindowGroup { | |
ContentView() |
OlderNewer