-
Notifications
You must be signed in to change notification settings - Fork 245
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add module that produces YT chapters from markers CSV
- Loading branch information
1 parent
d81d39d
commit ced8cad
Showing
6 changed files
with
131 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Changelog.Kits.MarkerKit do | ||
alias ChangelogWeb.TimeView | ||
NimbleCSV.define(CsvParser, separator: "\t", escape: "\"") | ||
|
||
# Name Start Duration Time Format Type Description | ||
def to_youtube(string) do | ||
string | ||
|> CsvParser.parse_string() | ||
|> Enum.map(fn [name, start | _] -> "#{duration(start)} #{name}" end) | ||
|> Enum.join("\n") | ||
end | ||
|
||
# Converting to seconds and back removes decimals and extra padding | ||
defp duration(start) do | ||
start |> TimeView.seconds() |> TimeView.duration() | ||
end | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
defmodule Changelog.MarkerKitTest do | ||
use ExUnit.Case | ||
import Changelog.TestCase | ||
alias Changelog.Kits.MarkerKit | ||
|
||
describe "to_youtube/1" do | ||
test "works for News 127" do | ||
[csv, desired] = | ||
"/markers/news-127.csv" | ||
|> fixtures_path() | ||
|> File.read!() | ||
|> String.split("---") | ||
|
||
assert MarkerKit.to_youtube(csv) == String.trim(desired) | ||
end | ||
|
||
test "works for Iterviews 624" do | ||
[csv, desired] = | ||
"/markers/interviews-624.csv" | ||
|> fixtures_path() | ||
|> File.read!() | ||
|> String.split("---") | ||
|
||
assert MarkerKit.to_youtube(csv) == String.trim(desired) | ||
end | ||
end | ||
end |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
Name Start Duration Time Format Type Description | ||
When NPR calls 00:01:41:14 00:00:00:00 24 fps Cue | ||
What is embedded? 00:03:23:18 00:00:00:00 24 fps Cue | ||
Programming non-computers 00:07:09:08 00:00:00:00 24 fps Cue | ||
How Elecia got started 00:11:40:22 00:00:00:00 24 fps Cue | ||
The moment of discovery 00:14:13:04 00:00:00:00 24 fps Cue | ||
Mentoring for embedded 00:15:48:22 00:00:00:00 24 fps Cue | ||
Wokwi is cool 00:18:43:00 00:00:00:00 24 fps Cue | ||
The chasm between sim and real 00:22:16:18 00:00:00:00 24 fps Cue | ||
The constraints of embedded 00:26:49:12 00:00:00:00 24 fps Cue | ||
SILICON VALLEY 00:30:13:10 00:00:00:00 24 fps Cue | ||
How big is the embedded world? 00:30:51:18 00:00:00:00 24 fps Cue | ||
Open source + embedded 00:34:49:16 00:00:00:00 24 fps Cue | ||
Elecia loves Kalman filters! 00:36:19:18 00:00:00:00 24 fps Cue | ||
Elecia's thoughts on self-driving cars 00:40:04:20 00:00:00:00 24 fps Cue | ||
Self-driving on a closed-system 00:49:27:12 00:00:00:00 24 fps Cue | ||
GoPro is embedded 00:51:29:18 00:00:00:00 24 fps Cue | ||
Traeger smokers are embedded 00:55:29:20 00:00:00:00 24 fps Cue | ||
What do you want to build next? 01:01:28:04 00:00:00:00 24 fps Cue | ||
Crunch Labs! 01:04:51:14 00:00:00:00 24 fps Cue | ||
What else is cool? 01:07:58:18 00:00:00:00 24 fps Cue | ||
Embedded is going everywhere 01:09:51:04 00:00:00:00 24 fps Cue | ||
IoT, let us 'opt out' 01:15:10:20 00:00:00:00 24 fps Cue | ||
Embedded.fm and other places 01:18:47:08 00:00:00:00 24 fps Cue | ||
Wrapping up 01:22:55:18 00:00:00:00 24 fps Cue | ||
--- | ||
01:41 When NPR calls | ||
03:23 What is embedded? | ||
07:09 Programming non-computers | ||
11:40 How Elecia got started | ||
14:13 The moment of discovery | ||
15:48 Mentoring for embedded | ||
18:43 Wokwi is cool | ||
22:16 The chasm between sim and real | ||
26:49 The constraints of embedded | ||
30:13 SILICON VALLEY | ||
30:51 How big is the embedded world? | ||
34:49 Open source + embedded | ||
36:19 Elecia loves Kalman filters! | ||
40:04 Elecia's thoughts on self-driving cars | ||
49:27 Self-driving on a closed-system | ||
51:29 GoPro is embedded | ||
55:29 Traeger smokers are embedded | ||
1:01:28 What do you want to build next? | ||
1:04:51 Crunch Labs! | ||
1:07:58 What else is cool? | ||
1:09:51 Embedded is going everywhere | ||
1:15:10 IoT, let us 'opt out' | ||
1:18:47 Embedded.fm and other places | ||
1:22:55 Wrapping up |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Name Start Duration Time Format Type Description | ||
What up, streaming nerds? 00:00:00.000 0:55.854 decimal Cue | ||
The new $30,000 side hustle 0:55.854 1:00.189 decimal Cue | ||
Mistakes we make in large codebases 1:56.044 1:02.989 decimal Cue | ||
Apple is killing Swift 2:59.033 0:58.213 decimal Cue | ||
Sponsor: Retool 3:57.247 1:13.584 decimal Cue | ||
Turns GitHub repos into interactive diagrams 5:10.826 0:32.453 decimal Cue | ||
Exploring a stablecoin bank 5:43.279 1:26.438 decimal Cue | ||
That's the news for now 7:09.718 1:05.632 decimal Cue | ||
--- | ||
00:00 What up, streaming nerds? | ||
00:56 The new $30,000 side hustle | ||
01:56 Mistakes we make in large codebases | ||
02:59 Apple is killing Swift | ||
03:57 Sponsor: Retool | ||
05:11 Turns GitHub repos into interactive diagrams | ||
05:43 Exploring a stablecoin bank | ||
07:10 That's the news for now |