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 Playground.Repo.Migrations.CreatePlayground.Psq.Answer do | |
use Ecto.Migration | |
def change do | |
create table(:psq_answers) do | |
add :survey_id, :integer | |
timestamps() | |
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
defmodule CardValidation do | |
def output_result(cards) do | |
cards | |
|> Enum.map(fn(card) -> | |
"#{card_type(card)}: #{card |> strip_card}" | |
|> String.ljust(30) | |
|> Kernel.<>("(#{luhn(card)})") | |
end) | |
|> Enum.join("\n") |
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
_COLUMNS=$(tput cols) | |
_MESSAGE=" FBI Warining " | |
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 )) | |
spaces=$(printf "%-${y}s" " ") | |
echo " " | |
echo -e "${spaces}\033[41;37;5m FBI WARNING \033[0m" | |
echo " " | |
_COLUMNS=$(tput cols) | |
_MESSAGE="Ferderal Law provides severe civil and criminal penalties for" |