This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
# Extracts all UTF-8 strings from YouTube's closed caption (`timedtext`) JSON | |
# object to generate a rough transcript. | |
# | |
# Instructions for acquiring the JSON: | |
# | |
# 1. Open the video in a new Firefox tab. Don't click "CC" yet. | |
# | |
# 2. Open Firefox Developer Tools (right-click somewhere and select "Inspect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
Note that this is a very rough, incomplete prototype. | |
More info on how to possibly leverage it here: https://github.com/tumblr/docs/issues/49 | |
--> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
{MobileAppHeaders} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# or simply: | |
'foobar'.tr 'A-Za-z','N-ZA-Mn-za-m' | |
# rot(x) | |
class String | |
def rot(num = 13) | |
return self.split("").collect { |ch| | |
if /^[a-z]$/ === ch | |
((ch[0] + num - 'a'[0]) % 26 + 'a'[0]).chr |