This is some code golfing that got out of hand. Written in a playground and as such uses simplistic test helpers that just return output strings. Copy and paste into Swift Playgrounds on iOS or a playground in XCode to run.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
t.prefs_.set('color-palette-overrides',["#000000", "#ff6d67", "#59f68d", "#f3f89d", "#c9a8fa", "#ff92d0", "#99ecfd", "#c7c7c7", "#676767", "#ff6d67", "#59f68d", "#f3f89d", "#c9a8fa", "#ff92d0", "#99ecfd", "#ffffff"]); | |
t.prefs_.set('foreground-color', "#f9f9f4"); | |
t.prefs_.set('background-color', "#272936"); | |
t.prefs_.set('cursor-color', 'rgba(187,187,187,0.5)'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// JSON.swift | |
// BonAppetit | |
// | |
// Created by Stefan Lindbohm on 17/02/15. | |
// Copyright (c) 2015 Stefan Lindbohm. All rights reserved. | |
// | |
import Foundation |
I hereby claim:
- I am stefanlindbohm on github.
- I am kolizz (https://keybase.io/kolizz) on keybase.
- I have a public key ASCFO_Vri1lXrvU7n2PO5sb43XiMBciLKmNR-LJwRR1vTQo
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Defaults: inconsistent calls | |
class Default { | |
init(first: Int, second: Int) { } | |
func method(first: Int, second: Int) { } | |
} | |
func defaultFunction(first: Int, second: Int) { } | |
let defaultObject = Default(first: 1, second: 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Class implementation with inheritance. | |
// | |
// Creates a constructor function with all the properties of ``params`` and | |
// keeps the ``constructor`` property of the prototype intact. | |
// | |
// Chains the object of special ``params`` key ``Extends`` on the prototype | |
// and prevents multiple calls to initialize in a MooTools Class compatible | |
// way. Property ``parent`` of the prototype is set to the chained object. | |
var Class = function(params) { | |
this.createConstructor(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postParameterNameComponents("postdata[with][dimensions]") | |
-> ["postdata", "with", "dimensions"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.font-size-leading(@font-size, @leading-ratio, @baseline-end-ratio) { | |
@leading: @baseline*round(@leading-ratio); | |
@baseline-end-distance: round(@font-size * @baseline-end-ratio + (@leading - @font-size) / 2); | |
font-size: @font-size; | |
line-height: @leading; | |
padding-top: @baseline-end-distance; | |
padding-bottom: @leading - @baseline-end-distance - (@baseline * (@leading-ratio - 1)); | |
} |