Skip to content

Instantly share code, notes, and snippets.

View brianmichel's full-sized avatar
🎯
Focusing

Brian Michel brianmichel

🎯
Focusing
View GitHub Profile
@stevestreza
stevestreza / DispatchQueueScheduler.swift
Last active June 29, 2023 13:06
A basic implementation of a Scheduler for Combine. Probably not a great implementation. Useful only as a toy, do not ship this.
//
// DispatchQueueScheduler.swift
//
import Combine
import Foundation
// DO NOT USE THIS IN PRODUCTION
struct DispatchQueueScheduler: Scheduler {
let queue: DispatchQueue
@yossorion
yossorion / what-i-wish-id-known-about-equity-before-joining-a-unicorn.md
Last active April 7, 2024 22:55
What I Wish I'd Known About Equity Before Joining A Unicorn

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@sozorogami
sozorogami / main.go
Created October 6, 2015 14:09
Convert `Podfile.lock` dependency list into a `.dot` file than can be opened in OmniGraffle
package main
import "os"
import "bufio"
import "io/ioutil"
import "regexp"
import "strings"
// Copy Podfile.lock contents into input.txt in same dir as script
@clementgenzmer
clementgenzmer / FBAnimationPerformanceTracker.h
Last active September 18, 2023 23:02
FBAnimationPerformanceTracker
/*
* This is an example provided by Facebook are for non-commercial testing and
* evaluation purposes only.
*
* Facebook reserves all rights not expressly granted.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON INFRINGEMENT. IN NO EVENT SHALL
* FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
@nicklockwood
nicklockwood / Hacking UIView Animation Blocks.md
Last active January 12, 2024 06:15
This article was originally written for objc.io issue 12, but didn't make the cut. It was intended to be read in the context of the other articles, so if you aren't familiar with concepts such as CALayer property animations and the role of actionForKey:, read the articles in that issue first.

Hacking UIView animation blocks for fun and profit

In this article, I'm going to explore a way that we can create views that implement custom Core Animation property animations in a natural way.

As we know, layers in iOS come in two flavours: Backing layers and hosted layers. The only difference between them is that the view acts as the layer delegate for its backing layer, but not for any hosted sublayers.

In order to implement the UIView transactional animation blocks, UIView disables all animations by default and then re-enables them individually as required. It does this using the actionForLayer:forKey: method.

Somewhat strangely, UIView doesn't enable animations for every property that CALayer does by default. A notable example is the layer.contents property, which is animatable by default for a hosted layer, but cannot be animated using a UIView animation block.

@staltz
staltz / introrx.md
Last active April 24, 2024 19:47
The introduction to Reactive Programming you've been missing
anonymous
anonymous / gist:6436768
Created September 4, 2013 13:15
;; Anything you type in here will be executed
;; immediately with the results shown on the
;; right.
;;
; Clojure uses maps to carry data around, instead of objects.
; So instead of creating a Name class, we might represent a name like so.
(def name {:first "Sean" :middle "Parker" :last "Brown"})
; It's common to use Clojure's keywords as keys in the map.
; One reason is that keywords are functions which take a map,
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active April 19, 2024 11:00
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application: