Skip to content

Instantly share code, notes, and snippets.

View Camilotk's full-sized avatar

Camilo Cunha de Azevedo Camilotk

View GitHub Profile
using System.Collections.Generic;
namespace ControleDeEntregas.Models
{
public sealed class Banco<T>
{
public static bool Update(IRepository<T> repositorio, T element)
{
repositorio.Update(element);
@Camilotk
Camilotk / Dapper.md
Last active September 2, 2019 01:03
  1. Create the Windows Form project
  2. Open M$ SQL Studio Manegement
  3. Login as User Auth
  4. Right click on databases -> New Database...
  5. Name It acordinly with your project and Ok
  6. Click in <your_database_name> and open Tables
  7. Right click on 'Tables' -> New -> Table
  8. Name it acordinly, but at least ensure that:
  • Has a integer column ID (and with Right Click -> Set as Primary Key, set as PK)
  • Has name varchar(50) or at least something similar
USE [master]
GO
/****** Object: Database [Pets] Script Date: 02/09/2019 14:49:34 ******/
CREATE DATABASE [Pets]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Pets', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.HAPPY\MSSQL\DATA\Pets.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB )
LOG ON
( NAME = N'Pets_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL14.HAPPY\MSSQL\DATA\Pets_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB )
GO

LSP - Liskov Substitution Principle

  1. Criar uma classe Pessoa, com propriedade nome e um método que retorna suas propriedades em um Set, nesse caso, apenas nome.
using System;
using System.Collections.Generic;

namespace LSP
{

Instalação do JDK 11, Tomcat 9 e Eclipse

JDK 11 Oracle

(Obs¹: JDK 11 é a versão LTS suportada até 2021)

(Obs²: A Plataforma de Java SE da Oracle - JDK, JRE, JavaFX e JRockit - somente é gratuita para o que a licensa define como "General Purpose Computing" e "Non-commercial applications" ou seja somente é gratuita caso seja usada para estudo, testes, durante o desenvolvimento de aplicações ainda não publicadas, projetos que sejam gratuitos e análise. Caso seja usado em um projeto comercial, a licensa deve ser comprada.)

  1. Ir na página de Download dos produtos da Oracle: https://www.oracle.com/downloads/
  2. Ir em "Java"
  3. Escolher "Java (JDK) for Developers"

Comandos de Terminal

Comando Alias/Abrv. O que faz? Exemplo
echo Imprime a string no output echo Hello World
mkdir make directory Cria um novo diretório mkdir nome_pasta
ln link Cria link ln ./arquivo /usr/caminho
chown change owner Muda o dono e grupo do arquivo chown x+a ./arquivo
chmod change mode Muda o modo de leitura do arquivo chomod 777 ./arquivo
touch Muda as inform. de leitura ou cria arquivo vazio touch index.php
@Camilotk
Camilotk / Lambda.js
Last active November 27, 2021 17:47
parse = n => (
n = n.name,
(n == "K") ? true :
(n == "KI") ? false : false
) // parsing to unpack meaning from the lambda calculus.
I = a => a // λa.a - Idiot - Identity
K = a => b => a // λab.a - Kestrel - first, const
KI = a => b => b // λab.b - Kite - second
M = f => f(f) // λf.ff - Mockingbird - self-application
@Camilotk
Camilotk / settings.json
Created May 23, 2020 19:38 — forked from diego3g/settings.json
✏️ Minha config do VSCode atualizada
{
"terminal.integrated.fontSize": 14,
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "newUntitledFile",
"editor.tabSize": 2,
"editor.fontSize": 18,
"editor.lineHeight": 26,
"editor.fontFamily": "Fira Code",
@Camilotk
Camilotk / tetris-4.rkt
Last active September 1, 2020 00:04 — forked from alex-hhh/tetris-4.rkt
Tetris Game, Final Version
;; A tetris game -- partial implementation, part 4
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions:
@Camilotk
Camilotk / tetris-4.rkt
Created September 1, 2020 00:04 — forked from alex-hhh/tetris-4.rkt
Tetris Game, Final Version
;; A tetris game -- partial implementation, part 4
;; Copyright (c) 2020 Alex Harsányi (AlexHarsanyi@gmail.com)
;; Permission is hereby granted, free of charge, to any person obtaining a
;; copy of this software and associated documentation files (the "Software"),
;; to deal in the Software without restriction, including without limitation
;; the rights to use, copy, modify, merge, publish, distribute, sublicense,
;; and/or sell copies of the Software, and to permit persons to whom the
;; Software is furnished to do so, subject to the following conditions: