Skip to content

Instantly share code, notes, and snippets.

View adriencanterot's full-sized avatar
🎯
Focusing

Adrien Cantérot adriencanterot

🎯
Focusing
View GitHub Profile
<!doctype html>
<html lang="fr">
<head>
<meta charset="utf-8">
<title>Welcome to diabetic kids glycemic digital notebook</title>
<link rel="stylesheet" href="styles.css">
<script>
function hideShowSecretInfos() {
var secretInfos = document.getElementById('secret_infos')
var hideShowLink = document.getElementById('showHideSecret')
//
// CoreDataTableViewController.swift
//
//
// Created by Fernando Rodríguez Romero on 22/02/16.
// Copyright © 2016 udacity.com. All rights reserved.
//
import UIKit
import CoreData
public struct User2712: Preparation {
public static func prepare(_ database: Database) throws {
try database.modify("users") { modifier in
modifier.double("doubleField")
}
}
public static func revert(_ detabase: Database) throws {
@adriencanterot
adriencanterot / AppDelegate.swift
Last active September 1, 2017 19:37
create a simple sqlite database for Fluent
func configureDatabase() {
let manager = FileManager.default
let applicationDirectory = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true)
let databasePath = applicationDirectory.first! + "/development.sqlite"
if !manager.fileExists(atPath: databasePath) {
manager.createFile(atPath: databasePath, contents: nil, attributes: nil)
}
let driver = try! SQLiteDriver(path: databasePath)
self.database = Fluent.Database(driver)
}
swiftenv versions
* 3.0-dev (set by /Users/adriencanterot/.swift-version)
DEVELOPMENT-SNAPSHOT-2016-05-03-a
DEVELOPMENT-SNAPSHOT-2016-05-09-a
2.2
swift --version
Apple Swift version 2.2 (swiftlang-703.0.18.8 clang-703.0.31)
Target: x86_64-apple-macosx10.9