Skip to content

Instantly share code, notes, and snippets.

@isaacsanders
isaacsanders / Equity.md
Created January 21, 2012 15:32
Joel Spolsky on Equity for Startups

This is a post by Joel Spolsky. The original post is linked at the bottom.

This is such a common question here and elsewhere that I will attempt to write the world's most canonical answer to this question. Hopefully in the future when someone on answers.onstartups asks how to split up the ownership of their new company, you can simply point to this answer.

The most important principle: Fairness, and the perception of fairness, is much more valuable than owning a large stake. Almost everything that can go wrong in a startup will go wrong, and one of the biggest things that can go wrong is huge, angry, shouting matches between the founders as to who worked harder, who owns more, whose idea was it anyway, etc. That is why I would always rather split a new company 50-50 with a friend than insist on owning 60% because "it was my idea," or because "I was more experienced" or anything else. Why? Because if I split the company 60-40, the company is going to fail when we argue ourselves to death. And if you ju

@mkuliszkiewicz
mkuliszkiewicz / UIView+GetColor.swift
Last active May 28, 2023 13:22
UIView extension which allows to get colour of any point inside
//
// UIView+GetColor.swift
// SwiftPick
//
// Created by Maciej Banasiewicz, Michał Apanowicz on 06/07/14.
//
//
import UIKit
@kristopherjohnson
kristopherjohnson / unzip.swift
Last active December 10, 2022 14:21
zip(), zip3(), unzip(), and unzip3() for Swift
// Given array of 2-tuples, return two arrays
func unzip<T, U>(array: [(T, U)]) -> ([T], [U]) {
var t = Array<T>()
var u = Array<U>()
for (a, b) in array {
t.append(a)
u.append(b)
}
return (t, u)
}
@andymatuschak
andymatuschak / CollectionViewDataSource.swift
Last active February 12, 2021 09:44
Type-safe value-oriented collection view data source
//
// CollectionViewDataSource.swift
// Khan Academy
//
// Created by Andy Matuschak on 10/14/14.
// Copyright (c) 2014 Khan Academy. All rights reserved.
//
import UIKit
@JaviLorbada
JaviLorbada / CustomFontPlayground.swift
Created August 31, 2015 19:09
Load custom fonts within Swift playgrounds
//: Playground - noun: a place where people can play
import UIKit
let fontURL = NSBundle.mainBundle().URLForResource("PillGothic300mg-bold", withExtension: "ttf")
CTFontManagerRegisterFontsForURL(fontURL!, CTFontManagerScope.Process, nil)
var pillGothicFontBold = UIFont(name: "PillGothic300mg-bold", size: 30)
var attrs = [NSFontAttributeName : pillGothicFontBold!,
@joemasilotti
joemasilotti / UI Testing - Mocking Network Data
Last active January 18, 2024 03:35
Xcode UI Testing - How to mock network data
.
@ashfurrow
ashfurrow / Fresh macOS Setup.md
Last active July 20, 2024 17:09
All the stuff I do on a fresh macOS Installation

Apps to install from macOS App Store:

  • Pastebot
  • GIF Brewery
  • Slack
  • Keynote/Pages/Numbers
  • 1Password
  • OmniFocus 3
  • Airmail 3
  • iA Writer
@AmitaiB
AmitaiB / NSAttributedString+HTML.swift
Last active April 23, 2019 10:21
Extends String to created NSAttributedStrings, and vice versa, for many encoding types, including HTML and RTF.
//
// NSAttributedString+HTML.swift
//
// Created by Amitai Blickstein on 6/22/16.
// Copyright © 2016 Amitai Blickstein, LLC. All rights reserved.
//
import UIKit
////////////////////////
W = 500
H = 585
W1 = W - 1
H1 = H - 1
def setup
@img = load_image '../scratch/girl.png'
@img.filter BLUR, 3
@img.load_pixels
end
@simme
simme / Label.swift
Created May 16, 2018 09:09
A `UILabel` subclass that allows content padding.
// MIT License applies.
import UIKit
/**
A `UILabel` subclass that provides a way of adding padding to the label.
*/
open class Label: UILabel {
/// The amount of padding for each side in the label.