Skip to content

Instantly share code, notes, and snippets.

View joeblau's full-sized avatar
🎉
It's a party

Joe Blau joeblau

🎉
It's a party
View GitHub Profile
@joeblau
joeblau / SegmentPagesView.swift
Created September 21, 2021 20:48
Segment Control + Pages
//
// ContentView.swift
// SegPage
//
// Created by Joe Blau on 9/21/21.
//
import SwiftUI
enum Page: Identifiable, CaseIterable, CustomStringConvertible {

Keybase proof

I hereby claim:

  • I am joeblau on github.
  • I am joeblau (https://keybase.io/joeblau) on keybase.
  • I have a public key ASD9LAhlVKLXdnWe8CI2LOLZbvXAuBjY8EQ0AtrbJidvbAo

To claim this, I am signing this object:

@joeblau
joeblau / pre-commit
Created June 1, 2019 16:57
Pre commit git hook to run SwiftLint and SwiftFormat
#!/bin/bash
# Place this file in `.git/hooks/`
if which swiftlint >/dev/null; then
swiftlint autocorrect
else
echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint"
fi
git diff --diff-filter=d --staged --name-only | grep -e '\(.*\).swift$' | while read line; do
@joeblau
joeblau / app.plist
Created May 28, 2019 15:40
Apple enterprise app distribution
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>

Animated Transition

  • VC asks transitioningDelegate “do you have an animated transition for me?”
  • delegate says “yes here is an <AnimatedTransitioning> object”
  • framework says “hey <AnimatedTransitioning> object; perform the transition, and here’s the <ContextTransitioning> that defines the container view, the from vc, the to vc, the frames, etc. tell the context when you’re done”
  • <AnimatedTransitioning> value does the animation and tells the <ContextTransitioning> value when it’s done
  • fin

Interactive Transition

  • VC asks transitioningDelegate “do you have an interactive transition for me?”
  • delegate says “yes, here is an <InteractiveTransitioning> and an <AnimatedTransitioning>
@joeblau
joeblau / simrecord
Created March 16, 2018 22:06 — forked from JohnSundell/simrecord
🎥 Script that lets you start a video recording from the iOS simulator with one command
#!/bin/bash
ITERATION=1
EXTENSION="mp4"
FILENAME="$HOME/Desktop/Simulator Recording.$EXTENSION"
while [ -e "$FILENAME" ]
do
ITERATION=$((ITERATION+1))
FILENAME="$HOME/Desktop/Simulator Recording $ITERATION.$EXTENSION"
@joeblau
joeblau / AppleCodeLogo.md
Created June 15, 2016 17:25
Apple Code Logo
                                    _.
                                _/=\:<
                              .#/*let}
                            //as\@#:~/
                           try()]:=./
                          *~let:>@{#
                          </>)#@~*/
                         (+~:~/+/
                         /={+"
@joeblau
joeblau / OSX Secure Disk Wipe.md
Last active June 12, 2023 07:37
Securely erase an external disk using dd on OSX

Securely erase an external disk using dd on OSX

  1. Plug in your SD card, HDD, or other block device and then use the following command to see which /dev/diskN node it's located on:
diskutil list
  1. Unmount the disk where “N� is the number of the disk taken from the above command:
@joeblau
joeblau / patatap.sh
Created March 26, 2014 18:52
Patatap Sounds Download Script
#!/bin/bash
array=( wipe veil prism-1 prism-2 prism-3 clay piston-1 piston-2 piston-3 flash-1 flash-2 flash-3 dotted-spiral suspension confetti timer ufo splits moon strike zig-zag squiggle bubbles corona pinwheel glimmer )
for i in "${array[@]}"
do
wget -nc "http://www.patatap.com/assets/A/$i.mp3" -P A/
wget -nc "http://www.patatap.com/assets/B/$i.mp3" -P B/
wget -nc "http://www.patatap.com/assets/C/$i.mp3" -P C/
wget -nc "http://www.patatap.com/assets/D/$i.mp3" -P D/
wget -nc "http://www.patatap.com/assets/E/$i.mp3" -P E/
@joeblau
joeblau / git yolo
Created February 3, 2014 12:48
git yolo command
alias gityolo='git commit -am "DEAL WITH IT" && git push -f origin master'