Skip to content

Instantly share code, notes, and snippets.

View seccomiro's full-sized avatar

Diego Stiehl seccomiro

View GitHub Profile
@seccomiro
seccomiro / AuthController.ts
Created May 9, 2021 23:24
AdonisJs v5 Authentication snippets
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
import User from 'App/Models/User'
export default class AuthController {
public async register({ view }: HttpContextContract) {
return view.render('auth/register')
}
public async store({ request, response, auth, session }: HttpContextContract) {
const data = request.only(['name', 'email', 'password'])
@seccomiro
seccomiro / ruby-2.7.1.sh
Last active April 17, 2020 16:33
Install rbenv, ruby-build, rbenv-vars and Ruby 2.7.1 on Ubuntu
#!/bin/sh
# Just run:
# sh -c "$(wget -O- https://gist.githubusercontent.com/seccomiro/1f6089a3dff09503cad3d6e8774d4b00/raw/fc8965c22237d527b29f95d05cabcf673ab2851d/ruby-2.7.1.sh)"
{ # this ensures the entire script is downloaded #
sudo apt install git build-essential libssl-dev zlib1g-dev
cd ~/.rbenv && src/configure && make -C src
git clone https://github.com/rbenv/rbenv.git ~/.rbenv

Atividade 0 - Git, GitHub e GitHub Classroom

Se você está vendo este repositório, provavelmente já aceitou sua primeira assignment (atribuições) na disciplina de Tópicos Avançados de TI.

Isto garante que você tenha acesso às demais atividades posteriores.

Assignments

Uma assignment (atribuição) é a forma que o GitHub Classroom utiliza para permitir que o aluno crie repositórios privados no GitHub de forma vinculada a alguma atividade criada pelo professor dentro da discplina.

@seccomiro
seccomiro / index.edge
Created October 22, 2019 13:52
index.edge
@layout('layout.master')
@section('conteudo')
<div class="text-center">
<h2>Minhas Tarefas</h2>
<a href="{{ route('tarefas.create') }}" class="btn btn-primary btn-lg mb-4">Nova Tarefa</a>
<div class="row justify-content-center">
<div class="col-lg-6 card text-left">
<ul class="list-group list-group-flush">
@each(tarefa in tarefas)
@seccomiro
seccomiro / show.edge
Created October 22, 2019 13:38
show.edge
@layout('layout.master')
@section('conteudo')
<div class="row justify-content-center">
<div class="col-lg-6">
<div class="card">
<div class="card-body">
<h5 class="card-title">{{ tarefa.titulo }}</h5>
<p class="card-text">{{ tarefa.descricao || '' }}</p>
<a href="{{ route('tarefas.edit', { id: tarefa.id }) }}" class="btn btn-primary">Editar</a>
@seccomiro
seccomiro / Handler.js
Created October 21, 2019 20:16
Handler.js
'use strict';
const Config = use('Config');
const BaseExceptionHandler = use('BaseExceptionHandler');
class ExceptionHandler extends BaseExceptionHandler {
async handle(error, { response }) {
if (
error.name === 'InvalidLoginException' ||
error.name === 'InvalidSessionException'
) {
@seccomiro
seccomiro / master.edge
Last active October 22, 2019 03:26
master.edge
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.10.2/css/all.min.css" integrity="sha256-zmfNZmXoNWBMemUOo1XUGFfc0ihGGLYdgtJS3KCr/l0=" crossorigin="anonymous">
{{ style('auth/auth-styles') }}
@seccomiro
seccomiro / TarefaController.js
Created October 7, 2019 23:15
Controller e views de exemplo para aula sobre framework AdonisJs
'use strict';
const Tarefa = use('App/Models/Tarefa');
/** @typedef {import('@adonisjs/framework/src/Request')} Request */
/** @typedef {import('@adonisjs/framework/src/Response')} Response */
/** @typedef {import('@adonisjs/framework/src/View')} View */
/**
* Resourceful controller for interacting with tarefas
@seccomiro
seccomiro / virtualbox-macos.sh
Created March 15, 2019 12:03
SH file to configure a virtual machine named "macOS" on VirtualBox (Linux)
#!/bin/bash
VBoxManage modifyvm "macOS" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "macOS" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "macOS" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
VBoxManage setextradata "macOS" VBoxInternal2/EfiGraphicsResolution 1920x1080