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 { |
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> |
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 |
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 |
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 |
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" |
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" |
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" |
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 |
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