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
[%{categories: ["programming", "coding", "elixir", "web-development"], | |
content: "I was tasked with a code challenge to create an Elixir/Phoenix app that would be a newsletter sending system. The requirements were simple and I had 48 hours to complete it. I lost a bit of time on the first day which caused me to cut some corners and not use TDD (tsk tsk). I had a deadline and...", | |
date: "Aug 11, 2017", | |
link: ["https://medium.brianemory.com/a-newsletter-sending-system-code-challenge-22da00d073cc"], | |
subheading: "Completing it taught me a lot", | |
title: "A Newsletter Sending System Code Challenge"}, | |
%{categories: ["learning", "elixir", "programming", "goals", "web-development"], | |
content: "I have been learning Elixir the last few months and I am really enjoying it. So much in fact, I am making that my main focus. This includes what I spend my time learning and programming, and where I apply to for jobs. Elixir 1.5 and Phoenix 1.3 just came out so it is a good time to buckle down and...", | |
date: "Aug 02, |
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
use Mix.Config | |
... # Code removed for readability | |
### Add that code below this line ### | |
# Configure Google OAuth | |
config :ueberauth, Ueberauth, | |
providers: [ | |
google: {Ueberauth.Strategy.Google, [default_scope: "email profile plus.me"]} |
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
<div class="hero-section"> | |
<div class="hero-section-text"> | |
<h1>Welcome to Catcasts!</h1> | |
</div> | |
</div> |
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
defmodule CatcastsWeb.AuthControllerTest do | |
use CatcastsWeb.ConnCase | |
alias Catcasts.Repo # add this line | |
alias Catcasts.User # add this line | |
@ueberauth_auth %{credentials: %{token: "fdsnoafhnoofh08h38h"}, | |
info: %{email: "batman@example.com", first_name: "Bruce", last_name: "Wayne"}, | |
provider: :google} | |
... # Code removed for readability |
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
defmodule Catcasts.Repo.Migrations.AddTokenToUsers do | |
use Ecto.Migration | |
def change do | |
alter table("users") do | |
add(:token, :string) | |
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
[ | |
inputs: ["mix.exs", "{config,lib,test}/**/*.{ex,exs}"] | |
] |
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
defmodule CatcastsWeb.VideoController do | |
use CatcastsWeb, :controller | |
use Rummage.Phoenix.Controller | |
... # Code removed for readability | |
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
defmodule CatcastsWeb.VideoView do | |
use CatcastsWeb, :view | |
use Rummage.Phoenix.View | |
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
defmodule CatcastsWeb.VideoController do | |
use CatcastsWeb, :controller | |
alias Catcasts.Videos | |
alias Catcasts.Videos.{Video, YoutubeData} | |
plug :check_video_owner when action in [:delete] | |
... # Code removed for readability |
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
describe "new video" do | |
test "renders form", %{conn: conn} do | |
user = insert(:user) | |
conn = conn | |
|> assign(:user, user) | |
|> get(video_path(conn, :new)) | |
assert html_response(conn, 200) =~ "Add video" | |
end |
NewerOlder