Skip to content

Instantly share code, notes, and snippets.

View jordanekay's full-sized avatar
🟢
Currently available for new projects

Jordan Kay jordanekay

🟢
Currently available for new projects
View GitHub Profile
@jordanekay
jordanekay / meta.md
Last active December 27, 2025 22:00
Intellectual Hipsters and Meta-Contrarianism 2025

Science has inexplicably failed to come up with a precise definition of "hipster", but from my limited understanding a hipster is a person who deliberately uses unpopular, obsolete, or obscure styles and preferences in an attempt to be "cooler" than the mainstream. But why would being deliberately uncool be cooler than being cool?

As previously discussed, in certain situations refusing to signal can be a sign of high status. Thorstein Veblen invented the term "conspicuous consumption" to refer to the showy spending habits of the nouveau riche, who unlike the established money of his day took great pains to signal their wealth by buying fast cars, expensive clothes, and shiny jewelery. Why was such flashiness common among new money but not old? Because the old money was so secure in their position that it never even occurred to them that they might be confused with poor people, whereas new money, with their lack of aristocratic breeding, worried they might be mistaken for poor people if they didn't make it bl

enum COVID {}
extension COVID {
struct Conditions {
let caseCount: Int
let hospitalizationCount: Int
let caseIncrease: Float
}
public struct Response {

This is not any kind of formal academic gloss on one of the most contested and considered terms in contemporary political history, neoliberal. I’m not qualified to write one of those. This is an attempt to convey what a lot of people mean when they use the term “neoliberal” in the context of 21st century progressive politics and what it meant in the recent past. This is a scribbling about my perception of how a contested term rose and fell and changed over time. I will leave the meaning of neoliberalism to others. But “neoliberalism” meant something in left-of-center political debates ten or fifteen years ago, and it was used like a comma, and now it means something different or less and I think about it a lot.

Traditionally neoliberalism had much more to do with conservatism than liberalism. It was Ronald Reagan and Margaret Thatcher who brought us a neoliberal revolution in the 1970s and 80s, after all. But you can read history books about that. In 2021 “neoliberal” as a pejorative tends to mean those who

@jordanekay
jordanekay / RoundRect.swift
Last active October 7, 2015 17:01
Replacement implementation of round-rect UIBezierPaths
import Darwin
private typealias Point = (x: CGFloat, y: CGFloat)
private typealias Points = (Point, Point?)
extension UIBezierPath {
public convenience init(rect: CGRect, cornerRadius radius: CGFloat, roundedCorners: UIRectCorner = .AllCorners) {
self.init()
let path = Path(rect: rect, radius: radius, roundedCorners: roundedCorners)
drawPath(path)
@jordanekay
jordanekay / MonolithViewController.swift
Last active September 12, 2015 04:02 — forked from asmallteapot/MonolithViewController.swift
Handling storyboard segues with enumerations in Swift
class MonolithViewController: UIViewController {
enum InnerSegueType {
case WebView
case Inspector
init?(segue: UIStoryboardSegue) {
if segue.identifier == "WebView" {
self = .WebView
} else if segue.identifier == "Inspector" {
self = .Inspector
@jordanekay
jordanekay / Dictionary.swift
Last active February 11, 2021 16:01
Mapping dictionaries in Swift
extension Dictionary {
public func map<T: Hashable, U>(@noescape transform: (Key, Value) -> (T, U)) -> [T: U] {
var result: [T: U] = [:]
for (key, value) in self {
let (transformedKey, transformedValue) = transform(key, value)
result[transformedKey] = transformedValue
}
return result
}
@jordanekay
jordanekay / Bigrams.swift
Last active August 29, 2015 14:14
Finding bigrams in text
func bigrams(text: String) -> [(String, String)] {
let words = split(text) { $0 == " " }
return Array(Zip2(words, words[1..<words.count]))
}
1> println(bigrams("one two three four five"))
[(one, two), (two, three), (three, four), (four, five)]
struct User {
let id: Int
let name: String
let email: String?
}
extension User: JSONDecodable {
static func create(id: Int, name: String, email: String?) -> User {
return User(id: id, name: name, email: email)
}
@jordanekay
jordanekay / gist:8855193
Created February 7, 2014 00:15
Debug -[UIScrollView setContentOffset:animated:] by changing duration
NSTimeInterval duration = 3.0;
SEL selector = @selector(_setContentOffsetAnimationDuration:);
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[scrollView methodSignatureForSelector:selector]];
[invocation setSelector:selector];
[invocation setTarget:scrollView];
[invocation setArgument:&duration atIndex:2];
[invocation invoke];
[scrollView setContentOffset:contentOffset animated:YES]
@implementation NSString (JSRemoveIrrelevantTags)
- (NSString *)js_stringByRemovingIrrelevantTags
{
NSMutableString *filteredString = [NSMutableString string];
NSSet *filteredLinguisticTags = [NSSet setWithArray:@[NSLinguisticTagDeterminer, NSLinguisticTagPreposition]];
[self enumerateLinguisticTagsInRange:NSMakeRange(0, self.length)
scheme:NSLinguisticTagSchemeLexicalClass