Skip to content

Instantly share code, notes, and snippets.

🔆 〰️ 🔥

Fero ferologics

🔆 〰️ 🔥
View GitHub Profile

[fit] Algebra to

[fit] (Co)monads

$$Cᴮᴬ = (Cᴮ)ᴬ$$

$$Cᴮᴬ = (Cᴮ)ᴬ$$

$$Pair<A,B> → C ≅ A → B → C$$

ferologics / DynamicFontLineHeight.swift
Created December 23, 2021 12:02
this example uses Dynamic Font with respect to line height line height
View DynamicFontLineHeight.swift
// MARK: - Helper
struct Layout { // this uses Dynamic Font and calculates spacing for correct line height
static let weight = SwiftUI.Font.Weight.semibold
static let size = UIFontMetrics.default.scaledValue(for: 17)
static let lineHeight = UIFontMetrics.default.scaledValue(for: 22)
static let uiFont = UIFont.systemFont(ofSize: size, weight: weight.toUIKit())
static let spacing = max(0, lineHeight - uiFont.lineHeight)
View binary_dsym_plist_gen.rb
require 'optimist'
require 'plist'
# Setups of source path mapping for the framework at framework_path,
# which has a dsym at dsym_path. It maps the source paths to the
# source_path root. Implementation borrowed from
def setup_dsym_source_mapping(framework_path, dsym_path, source_path)
binary_uuids = get_uuids_of_dwarf(framework_path)
dsym_uuids = get_uuids_of_dwarf(dsym_path)
verify_uuids(binary_uuids, dsym_uuids)
ferologics / tmux.conf
Created October 14, 2020 21:21 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
View tmux.conf
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
ferologics / tmux-cheatsheet.markdown
Created October 14, 2020 21:17 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname
View gist:f37fab88c49dd0eb6cbf0084e2450cfd
ACTION = build
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ferologics / Logger.swift
Last active July 2, 2018 20:29
Simple logger; to be modularised in to a framework
View Logger.swift
import Foundation
fileprivate let logName = "debug.log"
fileprivate var debugLog = "" {
didSet {
var _debugLog = debugLog
guard let rangeOfOldCharacetrs = _debugLog.range(of: oldValue) else { return }
let directory = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask).first
View RxSwift.swift
import Foundation
import RxSwift
// Source -
// MARK: - Observable seaquences
let helloSequence = Observable.just("goteeem")
let fibbonachiSequence = Observable.from([0,1,1,2,3,5])
let dictSequence = Observable.from([1:"Got",2:"Em"])

Value Subtypes and Generalized Enums, a manifesto

The goal of this document is to provide a comprehensive view of what value subtyping might look like in Swift and demonstrate how generalized enums play a significant role in this future.

Note: All syntax used in this document that is not currently valid Swift syntax is only intended to serve the purpose of demonstrating ideas and to serve as a point of reference for future proposals. The intent is not to propose that this exact syntax be used.

Acknowledgement: some of the ideas in this document have been inspired by Niko Matsakis' blog post exploring similar ideas in the context of Rust:


ferologics / Animation.elm
Last active April 2, 2021 17:20
Elm Native UI <-> Lottie
View Animation.elm
module Animation
( view
, style
, source
, progress
import NativeUi as NativeUi exposing (Property, Node)
import NativeUi.Style as Style