Skip to content

Instantly share code, notes, and snippets.

@boredzo
Last active December 18, 2015 12:59
Show Gist options
  • Star 24 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save boredzo/5787040 to your computer and use it in GitHub Desktop.
Save boredzo/5787040 to your computer and use it in GitHub Desktop.
Script to rename WWDC videos and slides PDFs to include the session title in the name. Also included: A list of the session numbers and (redacted where necessary) titles, in TSV format, for use with this script.
100 Keynote
101 Platforms State of the Union
102 Apple Design Awards
109 Painting the Future
200 Accessibility in OS X
201 Building User Interfaces for iOS 7
202 Accessibility in iOS
203 What’s New in Cocoa Touch
204 What’s New with Multitasking
205 What’s New in Cocoa
206 Getting Started with UIKit [REDACTED]
207 What’s New in Core Data and iCloud
208 What’s New in iOS User Interface Design
209 Improving Power Efficiency with App Nap
210 Introducing [REDACTED]
211 Core Data Performance Optimization and Debugging
213 Best Practices for Cocoa Animation
214 Customizing Your App’s Appearance for iOS 7
215 Optimizing Drawing and Scrolling on OS X
216 Bringing Your iOS Apps to OS X
217 Exploring Scroll Views on iOS 7
218 Custom Transitions Using View Controllers
219 Making Your App World-Ready
220 Advanced Text Layouts and Effects with [REDACTED]
221 Advanced Techniques with UIKit [REDACTED]
222 What’s New in State Restoration
223 Using Fonts with [REDACTED]
224 Designing Code for Performance
225 Best Practices for Great iOS UI Design
226 Implementing Engaging UI on iOS
227 Solutions to Common Date and Time Challenges
228 Hidden Gems in Cocoa and Cocoa Touch
300 Managing Apple Devices
301 Extending Your Apps for Enterprise and Education Use
302 What’s New in Passbook
303 Integrating Passbook into your Ecosystem
304 What’s New in Map Kit
305 Using Store Kit for In-App Purchases
306 What’s New in iTunes Connect
307 What’s New in Core Location
308 Using Receipts to Protect Your Digital Sales
309 Putting Map Kit in Perspective
310 Harnessing iOS to Create Magic in Your Apps
400 What’s New in Xcode 5
401 Xcode Core Concepts
402 What’s New in the LLVM Compiler
403 From Zero to App Store in Xcode 5
404 Advances in Objective-C
405 Interface Builder Core Concepts
406 Taking Control of Auto Layout in Xcode 5
407 Debugging with Xcode
408 Optimize Your Code Using LLVM
409 Testing in Xcode 5
410 Fixing Memory Issues
412 Continuous Integration with Xcode 5
413 Advanced Debugging with LLDB
414 Understanding Source Control in Xcode
415 Maximizing Apple Development Resources
416 Introducing AppleScript [REDACTED]
417 OS X Automation Update
500 What’s New in Scene Kit
501 Integrating with Game Controllers
502 Introduction to Sprite Kit
503 Designing Games with Sprite Kit
504 What’s New in Game Center
505 Advances in OpenGL ES
506 Turn-Based Gaming with Game Center
507 What’s New in OpenGL for OS X
508 Working with OpenCL
509 Core Image Effects and Techniques
600 What’s New in Safari and WebKit for Web Developers
601 Getting to Know Web Inspector
602 What’s New in Core Audio for iOS
603 Getting the Most Out of Web Inspector
604 Introducing iAd Workbench, The Best Way to Market Your App
605 What’s New in iBooks Author
606 Moving to AV Kit and AV Foundation
607 Power and Performance: Optimizing Your Website for Great Battery Life and Responsive Scrolling
608 Preparing and Presenting Media for Accessibility
609 Introduction to iBooks Author Widget and iAd Rich Media Ad Development with iAd Producer 4
610 What’s New in Camera Capture
611 Building Advanced iBooks HTML 5 Widgets and iAd Rich Media Ads
612 Advanced Editing with AV Foundation
613 iAd Integration and Best Practices
614 Implementing OS X Push Notifications for Websites
615 Integrating [REDACTED] into Native Apps
700 Designing Accessories for iOS and OS X
701 Maximizing Battery Life on OS X
702 Efficient Design with XPC
703 Core Bluetooth
704 Building Efficient OS X Apps
705 What’s New in Foundation Networking
707 What’s New in Kext Development
708 Nearby Networking with [REDACTED]
709 Protecting Secrets with the Keychain
710 A Practical Guide to the App Sandbox
711 Advances in AirPrint
712 Energy Best Practices
713 The Accelerate Framework
714 Protecting your Users’ Privacy
#!/usr/bin/env python
__author__ = 'prh'
import os
import re
filename_re = re.compile(r'^([0-9]+)(-[HS]D\.mov|\.pdf)')
def wwdcrename(path, wwdcsessions):
def addtitletoname(match):
number = match.group(1)
title = wwdcsessions[number]
suffix = match.group(2)
return ''.join([number, '-', title, suffix])
in_name = os.path.split(path)[-1]
out_name = filename_re.sub(addtitletoname, in_name)
if in_name == out_name:
return
os.rename(in_name, out_name)
print 'Renamed', repr(in_name), 'to', repr(out_name)
def wwdcrenameindir(topdirpath, wwdcsessions):
for (dirpath, dirname, filenames) in os.walk(topdirpath):
saved_cwd = os.getcwd()
os.chdir(dirpath)
for fn in filenames:
wwdcrename(fn, wwdcsessions)
os.chdir(saved_cwd)
def loadsessions(path):
"Returns a dictionary of session numbers to titles."
def session_pairs(lines):
session_re = re.compile(r'([0-9]+)\t(.+)')
for line in lines:
match = session_re.match(line)
number = match.group(1)
title = match.group(2)
yield (number, title)
return dict(session_pairs(open(path)))
def main(argv):
if len(argv) == 0:
print >>sys.stderr, 'Usage: wwdcrename sessions.txt [directory-or-file]+'
else:
sessions = loadsessions(argv[0])
for path in argv[1:]:
if os.path.isdir(path):
wwdcrenameindir(path, sessions)
else:
wwdcrename(path, sessions)
if __name__ == "__main__":
import sys
main(sys.argv[1:])
@tempelmann
Copy link

Much appreciated. I was going to start one myself, when I thought: Wait, someone must have done this already!

@jk
Copy link

jk commented Jun 20, 2013

I would even more appreciate a script which generates the non-redacted version of the files from the actual website. Does this already exist?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment