Skip to content

Instantly share code, notes, and snippets.

View tikitu's full-sized avatar

Tikitu de Jager tikitu

View GitHub Profile
//: Playground - noun: a place where people can play
//
// main.swift
// RoutingApproaches
//
// Created by Chris Eidhof on 01.08.18.
// Copyright © 2018 objc.io. All rights reserved.
//
@tikitu
tikitu / pipelines.swift
Last active March 12, 2018 19:36
Problems with functional pipelines in Swift
import UIKit
// Copy/paste me into a playground, I'm ready to roll!
// We're going to start with UIKit styling functions in the style
// let label = UILabel() |>
// textColor(.blue) >>> backgroundColor(.red)
// then run into difficulties with generifying those functions over protocols,
// and end with an alternative using <> and a nonstandard |>
@tikitu
tikitu / gist:db54e63edb31b3ef3148e257573db50c
Created January 20, 2017 12:04
Inconsistent implicit type conversions in Swift
Welcome to Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1). Type :help for assistance.
1> let an_int: Int = 3
an_int: Int = 3
2> an_int is Int?
$R0: Bool = true
3> [an_int] is [Int?]
$R1: Bool = true
4> let list_of_ints = [an_int]
list_of_ints: [Int] = 1 value {
[0] = 3
@tikitu
tikitu / gist:f549341956abd86b767e
Created October 4, 2014 20:58
My shortlist wishlist, in what would be priority order if I was perfectly rational and knew my preferences (hah!)
[
{
"title": "Meet Me At Infinity : The Uncollected Tiptree: Fiction and Nonfiction",
"author": "Jr., James Tiptree",
"isbn": "031286938X"
},
{
"title": "Through the narrow gate : the mythological consciousness of Russell Hoban",
"author": "Wilkie-Stibbs, Christine",
"isbn": "0838633390"
@tikitu
tikitu / gist:7773227
Last active December 30, 2015 03:59
ElasticSearch: bug in output format of field of type "byte" when using ?fields= with document get.
curl -XPOST "http://localhost:9200/my_index/my_type/_mapping" -d'
{
"my_type": {
"properties": {
"byte_field": {"type": "byte"},
"int_field": {"type": "integer"},
"long_field": {"type": "long"}
}
}
}'
# Set the prefix key to C-a instead of C-b, like GNU screen
set -g prefix C-a
bind a send-prefix
unbind C-b
set -s escape-time 1
bind r source-file ~/.tmux.conf \; display "Reloaded"
# Intuitive vertical/horizontal split keys