Skip to content

Instantly share code, notes, and snippets.

View florentmorin's full-sized avatar
🏠
Working from home

Florent Morin florentmorin

🏠
Working from home
View GitHub Profile
@florentmorin
florentmorin / UserProtocol.swift
Last active October 16, 2020 18:47
`URLProtocol` sample code
struct User: Encodable {
let firstName: String
let lastName: String
let admin: Bool
}
final class UserProtocol: URLProtocol {
override class func canInit(with request: URLRequest) -> Bool {
return true // Customize here
@florentmorin
florentmorin / DOSE-VACCIN-SCRIPTABLE.md
Last active April 9, 2021 11:14
Script « Vite ma dose de vaccin » pour Scriptable

Installation

  1. Télécharger l'app gratuite Scriptable.
  2. Coller le code de vaccin.js dans un nouveau script Scriptable
  3. Configurer le script (instructions dans le code)

Configurer le widget

  1. Ajouter un widget Scriptable
  2. Configurer le widget en sélectionnant votre script
@florentmorin
florentmorin / DarwinNotificationCenter.swift
Last active November 29, 2022 21:51 — forked from AvdLee/DarwinNotificationCenter.swift
A notification center for Darwin Notifications. MIT License applies.
//
// DarwinNotificationCenter.swift
//
// Copyright © 2017 WeTransfer. All rights reserved.
//
// Source: https://gist.github.com/florentmorin/35b15837cd4fb2a2a0630dbdf41d09aa
// Original: https://gist.github.com/AvdLee/07de0b0fe7dbc351541ab817b9eb6c1c
import Foundation
@florentmorin
florentmorin / ContentView.swift
Created June 2, 2021 09:57
A SwiftUI Burger menu
//
// ContentView.swift
// SwiftUIBurgerMenu
//
// Created by Florent Morin on 02/06/2021.
//
import SwiftUI
import Foundation
@florentmorin
florentmorin / MyApp.swift
Created February 14, 2024 11:07
Track scenes state on SwiftUI with visionOS
import SwiftUI
/// Main Window content
private struct MainView: View {
@Environment(\.appState) private var appState
@Environment(\.openWindow) private var openWindow
var body: some View {
NavigationStack {
VStack {