Skip to content

Instantly share code, notes, and snippets.

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
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")
@Cifer-Y
Cifer-Y / .sh
Created December 18, 2015 10:47
FBI warning
_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"