Skip to content

Instantly share code, notes, and snippets.

View victorferreira's full-sized avatar

Victor Ferreira victorferreira

View GitHub Profile
@victorferreira
victorferreira / Making it Swift.swift
Last active July 29, 2024 03:01
Updating SQLite Tutorial code to Swift 3. See the tutorial at: https://www.raywenderlich.com/123579/sqlite-tutorial-swift
//: Back to [The C API](@previous)
import SQLite
import Foundation
import PlaygroundSupport
destroyPart2Database()
//: # Making it Swift
sepal length sepal width petal length petal width class
5.1 3.5 1.4 0.2 Iris-setosa
4.9 3.0 1.4 0.2 Iris-setosa
4.7 3.2 1.3 0.2 Iris-setosa
4.6 3.1 1.5 0.2 Iris-setosa
5.0 3.6 1.4 0.2 Iris-setosa
5.4 3.9 1.7 0.4 Iris-setosa
4.6 3.4 1.4 0.3 Iris-setosa
5.0 3.4 1.5 0.2 Iris-setosa
4.4 2.9 1.4 0.2 Iris-setosa
@victorferreira
victorferreira / icloud.sh
Created May 6, 2024 15:45
useful iCloud terminal commands
# remove local download
brctl evict <path>
# download file locally
brctl download <path>
# restart icloud daemon
killall bird
@victorferreira
victorferreira / index.js
Created May 23, 2024 17:31
JS: reload module reference
let storage = require("./storage");
storage.add("hello");
console.log(storage.size()); // 1
storage.add("hello1");
console.log(storage.size()); // 2
storage = undefined;
delete require.cache[require.resolve("./storage")];