Skip to content

Instantly share code, notes, and snippets.

Avatar

Joshua Dance joshdance

View GitHub Profile
View gist:8bfa055ea86eb51c57b5a67970748948
Heuristics to tell great AUDIO stories
1. In Interviews, questions to always ask:
1. Tell me about...
2. How did you feel when... (or, how did that feel?)
3. Can you give me an example?
4. (Superlatives) Best, worst. funniest, scariest, hardest, least certain, favorite, etc...
5. (Dig for emotional moments)
2. in reviewing tape, look for three types of moments as good quotes to use:
1. Facts to understand the story (many can be voiced over if they drag on, so don't overlook if they're boring. Flag them.)
@joshdance
joshdance / CalcWeek.swift
Created Mar 23, 2018
See if a date is this week in Swift
View CalcWeek.swift
func calcPushupsThisWeek(){
let calendar = Calendar.current
var thisWeeksPushups = 0
let today = Date()
let todayComponents = calendar.dateComponents([.weekOfYear], from: today)
//I have an array of workout objects with dateOfWorkout properties. You can use any date here
for workout in myArray {
let workoutComponents = calendar.dateComponents([.weekOfYear], from: workout.dateOfWorkout)
if todayComponents.weekOfYear == workoutComponents.weekOfYear
@joshdance
joshdance / PlaySounds.swift
Last active Mar 22, 2018
Simple example of how to play sounds Swift 4
View PlaySounds.swift
class ViewController {
var audioPlayer = AVAudioPlayer()
struct Sounds {
static let startupSound: String = "soundname1.wav"
static let downSound: String = "soundname4.mp3"
static let upSound: String = "soundname3.aif"
static let saveSound: String = "soundname2.wav"
}
View compareDatesWithCalendar.swift
func calculatePushupsToday() {
//get todays date
let calendar = NSCalendar.current
var todaysPushupNumber = 0
for workout in myArray {
//see if any of the entries = today
if calendar.isDateInToday(workout.dateOfSave) == true
{
//add them up.
todaysPushupNumber = todaysPushupNumber + workout.numberOfPushups
You can’t perform that action at this time.