Skip to content

Commit aa3a8a6

Browse files
committed
some tweaks
1 parent 0be6daf commit aa3a8a6

4 files changed

Lines changed: 60 additions & 17 deletions

File tree

‎lib/c.ex‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,2 @@
11
defmodule C do
2-
@moduledoc """
3-
Documentation for C.
4-
"""
5-
6-
@doc """
7-
Hello world.
8-
9-
## Examples
10-
11-
iex> C.hello
12-
:world
13-
14-
"""
15-
def hello do
16-
:world
17-
end
182
end

‎lib/cli.ex‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ defmodule C.CLI do
3232
%{"html_url" => url} = C.Git.get_current_matching_pr()
3333
C.Util.open_in_browser(url)
3434
end
35+
def execute("gh", []) do
36+
{:ok, {org, repo}} = C.Git.github_org_and_repo()
37+
uri = "https://github.com/#{org}/#{repo}"
38+
C.Util.open_in_browser(uri)
39+
end
3540
def execute("gh", ["search", language | keywords]) do
3641
params = %{
3742
"type" => "Code",

‎lib/git.ex‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ defmodule C.Git do
6666
committer_email: "%ce", committer_name: "%cn"}
6767
@delimiter "$$;;"
6868

69-
def list_commits(), do: list_commits(File.cwd())
69+
def list_commits() do
70+
{:ok, cwd} = File.cwd()
71+
list_commits(cwd)
72+
end
7073
def list_commits(dir) do
7174
fields = [:hash, :author_date, :author_name, :subject]
7275
format = rev_parse_format(fields)

‎lib/play.ex‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
defmodule Play do
2+
@points [%{"end" => 14000, "message" => "And when the introduction keeps playing",
3+
"start" => 11000},
4+
%{"end" => 18000,
5+
"message" => "We go to the second transition of the introduction",
6+
"start" => 14000},
7+
%{"end" => 22000, "message" => "We switch to the design section",
8+
"start" => 18000},
9+
%{"end" => 26000, "message" => "And the design section will show a picture",
10+
"start" => 22000},
11+
%{"end" => 30000,
12+
"message" => "When I say the next word, we switch to the second picture",
13+
"start" => 26000},
14+
%{"end" => 34000, "message" => "And then the third picture", "start" => 30000},
15+
%{"end" => 37000, "message" => "Then we switch to the architectural section",
16+
"start" => 34000},
17+
%{"end" => 41000, "message" => "And you see a picture", "start" => 37000},
18+
%{"end" => 45000,
19+
"message" => "And you talk a little bit more and there is a blog post",
20+
"start" => 41000},
21+
%{"end" => 53000,
22+
"message" => "If you scroll down to the blog post it pauses what I say",
23+
"start" => 46000},
24+
%{"end" => 60000,
25+
"message" => "Now that you scroll back up, I resume, and we keep talking",
26+
"start" => 54000},
27+
%{"end" => 61000, "message" => "And we go to the roadmap section",
28+
"start" => 60000},
29+
%{"end" => 66000,
30+
"message" => "We're going through a little bit of a demo about the app model",
31+
"start" => 62000},
32+
%{"end" => 69000, "message" => "There's some fancy animation",
33+
"start" => 66000},
34+
%{"end" => 73000, "message" => "Talking about investors and paid users",
35+
"start" => 69000},
36+
%{"end" => 78000,
37+
"message" => "What happens when all of this goes horribly wrong",
38+
"start" => 73000}]
39+
40+
def run(base) do
41+
origin(@points, base)
42+
|> Enum.map(&Poison.encode!/1)
43+
|> Enum.each(&IO.puts/1)
44+
end
45+
46+
def origin(points, origin) do
47+
Enum.map(points, fn %{"start" => vstart, "end" => vend}=row ->
48+
%{row | "start" => vstart - origin, "end" => vend - origin}
49+
end)
50+
end
51+
end

0 commit comments

Comments
 (0)