Skip to content

Instantly share code, notes, and snippets.

View karlbecker's full-sized avatar

Karl Becker karlbecker

View GitHub Profile
@karlbecker
karlbecker / ember-page-object-cli-modern-collection-api-codemod.js
Created August 4, 2025 13:05
Convert ember-cli-page-object legacy collection approach involving itemScope to newer selector-first API
// jscodeshift codemod to migrate ember-cli-page-object legacy collection({ ... })
// to the newer selector-first API: collection('selector', { ... })
//
// Usage:
// npx jscodeshift -t scripts/collection-api-codemod.js tests/pages
//
// The transform handles the common pattern that was deprecated:
//
// items: collection({
// itemScope: '.item',
@karlbecker
karlbecker / NSURLComponents+QueryItemsDictionary.m
Last active January 21, 2016 05:08
NSURLComponents queryItems as an NSDictionary
//
// NSURLComponents+QueryItemsDictionary.m
// browzine
//
// Created by Karl Becker on 1/20/16.
// Copyright © 2016 Third Iron. All rights reserved.
//
// Requires https://github.com/grav/nsarray-functional
#import <Foundation/Foundation.h>
@karlbecker
karlbecker / fib
Last active January 19, 2016 23:58
fib
Write an implementation of the fibonacci function.
The fibonacci function is defined as follows:
It is a function that takes one parameter, n
and returns the nth number in the fibonacci sequence.
The fibonacci sequence is the sequence of numbers,
beginning with zero and then one, where all succeeding
numbers in the sequence are the sum of the previous two
numbers.