Skip to content

Instantly share code, notes, and snippets.

View jnutting's full-sized avatar

Jack Nutting jnutting

View GitHub Profile
@jnutting
jnutting / quicktalkaboutquicktalks.md
Created June 27, 2022 22:23
A Quick Talk About Quick Talks

Thank you all for coming, and welcome to today's presentation, "a quick talk about quick talks." I got the idea for this talk when I started getting feedback from some Shortcutters who told me that they're interested in doing a lighting talk at the Shortcut summit, but don't know where to begin, or what sort of topic to choose that will be interesting for listeners. Some people simply have little or no public speaking experience and want to change that. Hopefully, today's talk will help fill in some gaps for some of you Today’s talk will be recorded, and at the end of this presentation I will give you a link to the full text of this presentation for future reference.

Let me start off by saying that I'm not some sort of absolute expert when it comes to giving presentations. I'd say that I've given a few dozen different talks, at employers and clients, at local user groups and at conferences. But over the years I've watched hundreds of them. In doing so, I've noticed patterns and taken notes, and today I've

//
// GivenExpectation.swift
//
// Created by JN on 2022-5-8.
//
import Foundation
import XCTest
class Given<T> {
@jnutting
jnutting / Given+Expectation.swift
Created May 5, 2022 21:57
A very small TDD DSL in Swift
class Given<T> {
var sut: T
init(_ sut: T) {
self.sut = sut
}
func the<U>(_ keyPath: WritableKeyPath<T, U>, is u: U) -> Given {
sut[keyPath: keyPath] = u
return self
@jnutting
jnutting / Sequence+CompactMapFirst.swift
Last active January 31, 2019 14:45
A short-circuiting compactMap for Swift's Sequence, that returns up to a maximum number of non-nil items
/*
* Sequence's compactMap lets you transform one
* sequence of values into another, and strip
* out any nil results. Sometimes, all you want
* is the first non-nil result, and don't want
* to futher evaluate the transform for the
* remaining values in the original sequence.
* This lets you do that.
*/
extension Sequence {
#!/bin/sh
#
# Run this as an Xcode build phase in order to always set the build number
# of a freshly-built app equal to the number of commits in the master branch.
# This gives you an always-increasing build number, automatically.
#
# This sets the build number only in the build product, not in the source
# directory itself, so it doesn't dirty the repository. You can leave the
# build number in the Xcode project to "1" forever.
#!/bin/sh
#
# A post-build script for running in Xcode, to overlay app icons with some build info.
# Requires ImageMagick to be installed before use.
commit=`git rev-parse --short HEAD`
branch=`git rev-parse --abbrev-ref HEAD`
version=`/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}"`
function processIcon() {
@jnutting
jnutting / git rebase workflow
Created January 27, 2017 10:13
Short version of the git rebase workflow I usually use.
# Mostly from http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html
# See also https://github.com/thoughtbot/guides/blob/master/protocol/git/README.md
# Make a branch called feature_name
git checkout -b feature_name
# Assuming we are working in a branch called "feature_name”.
# Rebase against master frequently (maybe daily, or whenever you're at
# a good stopping point), to avoid conflicts at the end:
@jnutting
jnutting / WhiteSpace.txt
Created November 6, 2015 06:23
White Space (a parody of Taylor Swift’s “Blank Space”)
White Space
(sung to the tune of Taylor Swift’s “Blank Space”)
[Verse 1:]
Nice to meet you
where you been?
I can show you incredible things
Cocoa, ruby, ember, vim
Saw you there and I thought,
oh my god look at that noob,
@jnutting
jnutting / .gitignore
Created November 1, 2015 22:27
Unity stuff worthy of ignoring
[Ll]ibrary/
[Tt]emp/
[Oo]bj/
ExportedObj/
# Autogenerated VS/MD solution and project files
*.csproj
*.unityproj
*.sln
@jnutting
jnutting / gist:8113856d0ba0f249e27f
Created November 5, 2014 21:36
All About That Spec (Lyrics)
All about that Spec
Yeah, it's pretty clear / I've made an app or two
And I can TDD it / Like I'm supposed to do
I do that red-green / Refactor most days
All the right tests / In all the right places
I see them old-timers / Working that FORTRAN shop
We know that shit ain't real / C'mon now make it stop
If you've got agile methods / Just raise em up