Skip to content

Instantly share code, notes, and snippets.

View jorgedjr21's full-sized avatar
🖥️
Coding...

Jorge David C.T Junior jorgedjr21

🖥️
Coding...
View GitHub Profile
@jorgedjr21
jorgedjr21 / numbers.rb
Created May 7, 2020 22:40
Questão 2 - Números
require 'prime'
def number_type(number)
is_esoteric = (number % 3 == 0 || number % 5 == 0) ? true : false
is_prime = Prime.prime?(number)
" O numéro é #{is_esoteric ? "esotérico" : "cético"} e #{ is_prime ? "primo" : "não primo"}"
end
@jorgedjr21
jorgedjr21 / rooms.rb
Last active May 7, 2020 22:33
Questão 1 - Seleção da sala
require 'date'
ROOM_1 = 9207 # limit in number of days for 25 years, 2 months and 15 days
ROOM_2 = 16467 # limit in number of days for 45 years and one month
ROOM_3 = 23741 # limit in number of days for 65 years
def room_selection(birthday)
now = Date.today
birthdate = Date.parse(birthday)
difference = (now - birthdate).to_i
defmodule ContasappWeb.NavbarTest do
use ContasappWeb.ConnCase
test "shows a sign in with google link when not signed in", %{conn: conn} do
conn = get conn, "/"
assert html_response(conn, 200) =~ "Login with Google"
end
end
@jorgedjr21
jorgedjr21 / result
Last active February 10, 2020 20:43
Fetch and install dependencie? [Yn] Y
* running mix deps.get
* running mix deps.compile
* running cd assets && npm install && node
node_modules/webpack/bin/webpack.js --mode development
 $ cd contasapp
Then configure your database in config/dev.exs and run:
 $ mix ecto.create
Start your Phoenix app with:
 $ mix phx.server
@jorgedjr21
jorgedjr21 / app.html.eex
Created November 25, 2019 17:41
lib/contasapp_web/templates/layout/app.html.eex
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Contasapp · Phoenix Framework</title>
<link rel="stylesheet" href="<%= Routes.static_path(@conn, "/css/app.css") %>"/>
</head>
<body>
@jorgedjr21
jorgedjr21 / _navbar.html.eex
Created November 25, 2019 17:36
lib/contasapp_web/templates/layout/_navbar.html.eex
<nav class="navbar navbar-expand-lg navbar-dark bg-primary">
<a class="navbar-brand" href="#">Contas App</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
@jorgedjr21
jorgedjr21 / navbar_test.exs
Created November 25, 2019 17:31
test/contasapp_web/templates/navbar_test.exs
defmodule ContasappWeb.NavbarTest do
use ContasappWeb.ConnCase
test "should show an Sign in with Google link when not signed_in", %{conn: conn} do
conn = get conn, "/"
assert html_response(conn, 200) =~ "Login with Google"
end
end
const path = require('path');
const glob = require('glob');
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const OptimizeCSSAssetsPlugin = require('optimize-css-assets-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = (env, options) => ({
optimization: {
minimizer: [
// We need to import the CSS so that webpack will load it.
// The MiniCssExtractPlugin is used to separate it out into
// its own CSS file.
import css from "../css/app.css"
// webpack automatically bundles all modules in your
// entry points. Those entry points can be configured
// in "webpack.config.js".
//
// Import dependencies
/* This file is for your main application css. */
@import "../node_modules/bootstrap/dist/css/bootstrap.min.css";
@import "../node_modules/@fortawesome/fontawesome-free/css/all.min.css";
@import "./theme/cosmo.min.css";
.alert:empty{
display: none;
}