Skip to content

Instantly share code, notes, and snippets.

View subdigital's full-sized avatar

Ben Scheirman subdigital

View GitHub Profile
@subdigital
subdigital / largest_sequence.swift
Created November 30, 2016 02:47
Given a sorted array of ints, returns the largest consecutive streak contained.
func largestSeq(values: [Int]) -> Int {
let initial: (current: Int, max: Int, prev: Int?) = (0, 0, nil)
let result = values.reduce(initial) { acc, el in
if acc.prev == nil {
return (1, 1, el)
}
let current = el - acc.prev! == 1 ? acc.current + 1 : 1
let newMax = max(current, acc.max)
return (current, newMax, el)
@subdigital
subdigital / radars.txt
Last active December 6, 2022 09:29
Xcode Vim Radars
These are feedbacks I've filed against Xcode 13's Vim support. Please dupe!
Vim mode needs option to turn off audible bell - FB9136734
Vim mode needs option to disable/hide help bar - FB9138240
Vim mode needs CTRL+SHIFT+V columnar select mode - FB9138552
Vim mode missing macros for repeated text operations - FB9138595
Vim mode - support for plugins? - FB9138670
Vim mode - :w should save the file - FB9138695
Vim mode - shift-V doesn’t correctly select the first full line - FB9138796
Vim mode - Allow repeated editing operations with “.” - FB9154817
@subdigital
subdigital / camelCaseLines.js
Created December 1, 2021 21:50
Boop script that allows camelCase to work on lines
/**
{
"api": 1,
"name": "Camel Case Lines",
"description": "Camel Case, but for each line",
"author": "Ben Scheirman",
"icon": "tortoise",
"tags": "camelCase"
}
**/