Skip to content

Instantly share code, notes, and snippets.

View jellybeansoup's full-sized avatar

Daniel Farrelly jellybeansoup

View GitHub Profile
@jellybeansoup
jellybeansoup / example.json
Last active September 6, 2015 00:08
Example JSON for Mobile Couch e65
[
{
"key": "jellyandbean",
"title": "Jelly and Bean",
"tagline": "A weekly podcast about TV, movies, games and technology.",
"description": "Do you like tech? Games? TV? Movies? Well DANG. We have so much in common already! Jelly and Bean are two super pals who like to talk about all of the aforementioned topics (and more, probably), resulting in a nice little peek into the world of geeks, all in the form of a delicious weekly podcast that can be shoved into your ears thanks to the magic of sound waves!",
"archived": true,
"explicit": false,
"keywords": [
"jelly n bean",

Keybase proof

I hereby claim:

  • I am jellybeansoup on github.
  • I am jellybeansoup (https://keybase.io/jellybeansoup) on keybase.
  • I have a public key whose fingerprint is EEC8 CE91 DF6B 324F C28D ACAA E53E 0BCA FCDB 7881

To claim this, I am signing this object:

@jellybeansoup
jellybeansoup / TextViewDidChangeSelection.swift
Created August 15, 2017 05:39
textViewDidChangeSelection(_:)
// Exists inside of a scrollview subclass containing an "expanding" textview that lives underneath other content.
private var previousSelection: CGRect?
func textViewDidChangeSelection(_ textView: UITextView) {
guard textView.isFirstResponder else {
return
}
var selection = textView.layoutManager.boundingRect(forGlyphRange: textView.selectedRange, in: textView.textContainer).offsetBy(dx: insets.left, dy: insets.top)
@jellybeansoup
jellybeansoup / AppDelegate.swift
Created January 23, 2018 05:39
Preloading App Data for Screenshots
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
prepareForTestingUI()
// Handle the actual launch of your application
}
private func prepareForTestingUI() {
guard let contentsURL = Bundle.main.url(forResource: "UITests", withExtension: "xcappdata")?.appendingPathComponent("AppData") else {
return
}
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
SYMBOLICATE="/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash"
for f in "$@"
do
SRCNAME=$(echo $(basename "${f}"))
SRCPATH=$(echo $(dirname "${f}"))
DSTPATH="${SRCPATH}/${SRCNAME%.*}.symbolicated.ips"
import Foundation
actor SixSidedDie {
struct Environment: Sendable {
var doTheThing: @Sendable (_ range: ClosedRange<Int>) -> Int
}