View css-specificity-example.css
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
.heading { | |
color: blue; | |
} | |
h1 { | |
color: green !important; | |
} | |
#witty { |
View css-specificity-example.html
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>CSS Specificity</title> | |
<link rel="stylesheet" href="main.css"> | |
</head> | |
<body> | |
<h1 class="heading">Heading tag</h1> |
View maxchars.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 Maxchar do | |
@moduledoc """ | |
Given a string, return the character that occurs most frequently | |
""" | |
def main(str) when is_binary(str) do | |
str | |
|> count_chars() | |
|> print() | |
end |
View pipelines_final.ex
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
# using pipelines | |
"freddy" | |
|> String.capitalize() | |
|> String.reverse() | |
|> String.ends_with?("F") | |
#=> true | |
# using nested functions | |
String.ends_with?(String.reverse(String.capitalize("freddy")), "F") | |
#=> true |
View pipelines_step3.ex
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
# step 3 | |
iex> "freddy" |> String.capitalize() |> String.reverse() |> String.ends_with?("F") | |
true |
View pipelines_step2.ex
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
# step 2 | |
iex> "freddy" |> String.capitalize() |> String.reverse() | |
"ydderF" |
View pipelines_step1.ex
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
# step 1 | |
iex> "freddy" |> String.capitalize() | |
"Freddy" |
View pipelines_step0.ex
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
# step 0 | |
iex> "freddy" | |
"freddy" |
View mix.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
# shortened for brevity | |
defp aliases do | |
[ | |
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], | |
"ecto.reset": ["ecto.drop", "ecto.setup"], | |
"test": ["ecto.create --quiet", "ecto.migrate", "test"], | |
"ecto.migrate": ["ecto.migrate", "ecto.dump"] | |
] | |
end |
View prod.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
# /config/prod.exs on Heroku | |
use Mix.Config | |
# Configure for SSL | |
config :app, AppWeb.Endpoint, | |
load_from_system_env: true, | |
url: [scheme: "https", host: "https://app.herokuapp.com", port: 443], | |
force_ssl: [rewrite_on: [:x_forwarded_proto]], | |
cache_static_manifest: "priv/static/cache_manifest.json", | |
secret_key_base: Map.fetch!(System.get_env(), "SECRET_KEY_BASE") |
NewerOlder