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 / Autostart Adhearsion
Last active December 22, 2015 01:49
Autostart Adhearsion
Adhearsion init.d script
Working with Ubuntu 12.04 and RVM on EC2
1. Copy-paste adhearsion content to "/etc/init.d/" directory
2. Run "sudo chmod +x /etc/init.d/adhearsion"
3. Run "sudo /usr/sbin/update-rc.d -f adhearsion"
4. Create /etc/adhearsion directory (one configuration file per app)
5. Configure your applications in /etc/adhearsion/{app_name}.conf (sample code in "my_app.conf")
6. Run your service with "sudo service adhearsion start"

Keybase proof

I hereby claim:

  • I am florentmorin on github.
  • I am florentmorin (https://keybase.io/florentmorin) on keybase.
  • I have a public key ASC6eOVmfQPYMOISvEMVy9kvbW2DDHFOKq9lGvLLAsC9UQo

To claim this, I am signing this object:

@florentmorin
florentmorin / prepare.sh
Last active November 4, 2017 11:23
Generate Xcode from Cordova
#!/bin/sh
cordova -d prepare ios --release
@florentmorin
florentmorin / MainViewController.m
Created November 4, 2017 11:30
Cordova Main View Controller for iPhone X
- (void)viewWillAppear:(BOOL)animated
{
// View defaults to full size. If you want to customize the view's size, or its subviews (e.g. webView),
// you can do so here.
[super viewWillAppear:animated];
// Fix for iOS 11 status bar UI
if (@available(iOS 11.0, *)) {
@florentmorin
florentmorin / MySDK.h
Last active December 19, 2017 10:10
Non-modular integration of Common Crypto library into Swift Framework
@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>
@florentmorin
florentmorin / requete.http
Created February 11, 2018 13:33
Requête HTTP Basique
GET /monsite.html HTTP/1.1
Host: www.monsite.com
Connection: Close
@florentmorin
florentmorin / README.md
Last active February 11, 2018 13:47
Simple exemple d'empreinte SHA-256

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 / ContentView.swift
Last active April 13, 2024 17:15
A small hack to make `MFMailComposeViewController` and `MFMessageComposeViewController` working fine with SwiftUI
//
// 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 / TopMostViewController.swift
Created June 30, 2019 11:05
Top Most View Controller in UIKit
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 / darkmode.css
Last active April 13, 2020 21:42
Mode sombre et accessibilité
h1 {
color: black;
}
@media (prefers-color-scheme: dark) {
h1 {
color: white;
}
}