Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Florent Morin florentmorin

🏠
Working from home
View GitHub Profile
View ContentView.swift
//
// ContentView.swift
// SwiftUIBurgerMenu
//
// Created by Florent Morin on 02/06/2021.
//
import SwiftUI
import Foundation
@florentmorin
florentmorin / DarwinNotificationCenter.swift
Last active Sep 17, 2021 — forked from AvdLee/DarwinNotificationCenter.swift
A notification center for Darwin Notifications. MIT License applies.
View DarwinNotificationCenter.swift
//
// 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 / DOSE-VACCIN-SCRIPTABLE.md
Last active Apr 9, 2021
Script « Vite ma dose de vaccin » pour Scriptable
View DOSE-VACCIN-SCRIPTABLE.md

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 / UserProtocol.swift
Last active Oct 16, 2020
`URLProtocol` sample code
View UserProtocol.swift
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 / darkmode.css
Last active Apr 13, 2020
Mode sombre et accessibilité
View darkmode.css
h1 {
color: black;
}
@media (prefers-color-scheme: dark) {
h1 {
color: white;
}
}
@florentmorin
florentmorin / TopMostViewController.swift
Created Jun 30, 2019
Top Most View Controller in UIKit
View TopMostViewController.swift
import UIKit
extension UIViewController {
/// Top most view controller in view hierarchy
var topMostViewController: UIViewController {
// No presented view controller? Current controller is the most view controller
guard let presentedViewController = self.presentedViewController else {
return self
@florentmorin
florentmorin / ContentView.swift
Last active Mar 15, 2021
A small hack to make `MFMailComposeViewController` and `MFMessageComposeViewController` working fine with SwiftUI
View ContentView.swift
//
// ContentView.swift
// MailDemo
//
// Created by Florent Morin on 29/06/2019.
// Copyright © 2019 Morin Innovation. All rights reserved.
//
// Medium link: https://medium.com/@florentmorin/messageui-swiftui-and-uikit-integration-82d91159b0bd
// Sample source code: https://github.com/florentmorin/SwiftUIAndMessageUI
@florentmorin
florentmorin / README.md
Last active Feb 11, 2018
Simple exemple d'empreinte SHA-256
View README.md

Signature via hachage SHA-256

Le fichier test.txt est le fichier signé.

Le fichier test.txt.sha256 est sa signature.

Le script calculate_checksum.sh permet de générer la signature.

@florentmorin
florentmorin / requete.http
Created Feb 11, 2018
Requête HTTP Basique
View requete.http
GET /monsite.html HTTP/1.1
Host: www.monsite.com
Connection: Close
@florentmorin
florentmorin / MySDK.h
Last active Dec 19, 2017
Non-modular integration of Common Crypto library into Swift Framework
View MySDK.h
@import Foundation;
//! Project version number for MySDK.
FOUNDATION_EXPORT double MySDKVersionNumber;
//! Project version string for MySDK.
FOUNDATION_EXPORT const unsigned char MySDKVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <MySDK/PublicHeader.h>
#import <MySDK/MySDKCrypto.h>