Skip to content

Instantly share code, notes, and snippets.

@eungju
Created March 13, 2016 01:31
Show Gist options
  • Save eungju/01c831cf04763af7a9b4 to your computer and use it in GitHub Desktop.
Save eungju/01c831cf04763af7a9b4 to your computer and use it in GitHub Desktop.
SMI 자막 시간 조절
#!/usr/bin/env elixir
{d, _} = Integer.parse(Enum.at(System.argv(), 0))
IO.stream(:stdio, :line)
|> Stream.map(&Regex.replace(~r/<SYNC Start=(\d+)>/i, &1, fn _, g1 -> {t, _} = Integer.parse(g1); "<SYNC Start=#{t + d}>" end))
|> Stream.each(&IO.write/1)
|> Stream.run
@eungju
Copy link
Author

eungju commented Mar 13, 2016

$ cat foo.smi | smi-adjust.exs 27000 > foo-adjusted.smi

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