Skip to content

Instantly share code, notes, and snippets.

View michaelnisi's full-sized avatar
🌐

Michael Nisi michaelnisi

🌐
View GitHub Profile

Keybase proof

I hereby claim:

  • I am michaelnisi on github.
  • I am nisi (https://keybase.io/nisi) on keybase.
  • I have a public key whose fingerprint is A7B6 30CD 455E CB26 FA54 59D8 7D86 8537 BEE8 7307

To claim this, I am signing this object:

@michaelnisi
michaelnisi / gist:b00e5ad25d39f08d2888
Created February 23, 2015 18:03
iOS 8.1 SQLite Pragmas
[auto_vacuum: 0]
[automatic_index: 1]
[cache_size: 250]
[checkpoint_fullfsync: 1]
[name: NOCASE, seq: 0]
[name: RTRIM, seq: 1]
[name: BINARY, seq: 2]
[compile_option: CURDIR]
[compile_option: ENABLE_FTS3]
[compile_option: ENABLE_FTS3_PARENTHESIS]
@michaelnisi
michaelnisi / unpack.swift
Last active August 29, 2015 14:20
Unpack array of any optionals
import Foundation
let items: [Any?] = [0, [], "a", nil, "b", nil, "c"]
let strings = reduce(items, [String]()) {
if let string = $1 as? String {
return $0 + [string]
} else {
return $0
}
}
@michaelnisi
michaelnisi / gist:63d973f3bf5853e33e9a
Created June 1, 2015 18:56
Basho cold emailing me
Michael,
Hope you're well. I know i've been in touch in the past.
I appreciate that you are busy. The reason i'm reaching out is because i'm sure that you've heard the term NoSQL?
I want to help you understand how Riak fits in this space, and how as a NoSQL Key Value store we are powering online applications for some of the biggest companies worldwide, in a whole host of industries.
E.g -
William Hill
@michaelnisi
michaelnisi / configure_otp.sh
Last active February 10, 2019 08:45
Configure Erlang/OTP build on macOS with pkgin
./configure --without-javac --without-odbc --with-ssl=/opt/pkg
@michaelnisi
michaelnisi / update_settings
Last active August 6, 2020 21:01
Updating the version number in a iOS settings bundle
#!/usr/bin/env bash
set -o xtrace
SOURCE="${BASH_SOURCE[0]}"
if [[ -h $SOURCE ]]; then
SOURCE="$( readlink "$SOURCE" )"
fi
SOURCE_ROOT="${SOURCE_ROOT:-$( cd -P "$( dirname "$SOURCE" )/.." && pwd )}"
@michaelnisi
michaelnisi / tokens.swift
Created September 9, 2018 04:41
Persisting Change Tokens for CloudKit Sync
// MARK: - Storing and Accessing Change Tokens
fileprivate extension UserDefaults {
fileprivate func setUUID(_ uuid: UUID, using key: String) {
self.set(uuid.uuidString, forKey: key)
}
fileprivate func uuid(matching key: String) -> UUID? {
guard let str = UserDefaults.standard.string(forKey: key) else {
@michaelnisi
michaelnisi / ReportCrash
Created August 1, 2019 08:44
The app was killed due to memory reasons
default 2019-07-17 15:33:36.771581 +0200 ReportCrash Process MyApp [24519] killed by jetsam reason per-process-limit