Skip to content

Instantly share code, notes, and snippets.

@kristianfreeman
Created March 18, 2014 16:32
Show Gist options
  • Save kristianfreeman/9623799 to your computer and use it in GitHub Desktop.
Save kristianfreeman/9623799 to your computer and use it in GitHub Desktop.
Renaming script for WWDC 2013 videos
class WWDC
NAMES = {
"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 Dynamics",
"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 Text Kit",
"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 Text Kit",
"221" => "Advanced Techniques with UIKit Dynamics",
"222" => "What's New in State Restoration",
"223" => "Using Fonts with Text Kit",
"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 Libraries",
"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 JavaScript 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 Multipeer Connectivity",
"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"
}
class << self
attr_accessor :files
attr_accessor :dry
def get_files
self.files = Dir["*.mov"]
end
def rename
self.dry = true if ARGV.first != "-f"
get_files
files.each do |file|
number = file.gsub("-SD.mov", "")
new_name = "#{number} - #{NAMES[number]}.mov"
if dry
puts "In dry mode. Would rename #{ file } to #{new_name}"
else
puts "Running for real!"
File.rename(file, new_name)
end
end
end
end
end
# 100-SD.mov => 100 - Keynote.mov
# Run with -f arg from command-line to run "fo real".
# Otherwise, dry mode to be safe.
WWDC.rename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment