Skip to content

Instantly share code, notes, and snippets.

View erlimar's full-sized avatar

Erlimar Silva Campos erlimar

View GitHub Profile
@erlimar
erlimar / Ideia.cs
Last active January 29, 2021 16:45
BussinessActions
namespace MyApp
{
interface IBussinessOriginOf<TTo>
{
Type Origin { get; }
}
class BusinessOrigin<TFrom, TTo> : ITransformer<TFrom, TTo>, IBussinessOriginOf<TTo>
{
TTo Transform(TFrom from)
@erlimar
erlimar / aprendizado.txt
Last active August 14, 2020 18:07
Python - Jogo Advinha
- [ ] Executar instruções sequenciais
- [ ] Desenhar fluxo feliz do programa
- [ ] Entender escopo ou bloco
- [ ] Definir e chamar funções
> Usar parâmetros de funções
> Retornar e usar valores retornados de funções
- [ ] Entender tipos
> Python é dinamicamente tipado. O que é isso?
> '3' é diferente de 3
> conversão para inteiro "int()"
@erlimar
erlimar / Docs.md
Last active January 9, 2023 13:11
Notas sobre UnitOfWork

Você pode conferir o conceito sobre Unit of Work neste link: https://martinfowler.com/eaaCatalog/unitOfWork.html.

No .NET usamos Entity Framework Core como base para manipulação de dados, e lá o objeto DbContext foi projetado para funcionar como uma unidade de trabalho, e conforme descrito pelo próprio link acima. Confira na documentação oficial através dete link: https://learn.microsoft.com/en-us/ef/core/dbcontext-configuration/.

Consideramos que aplicar o padrão Unit of Work usando .NET e Entity Framework Core é simples pois já tem o trabalho principal todo implementado. Porém ainda resta o controle de transações que também é mencioado quando falamos do uso desse padrão.

@erlimar
erlimar / perl-encoding.md
Last active February 11, 2020 13:47
Testes com Perl e arquivos não UTF-8

Utilizando arquivo ASCII com acentos configurando no terminal

  1. Com o Notepad do Windows salve o arquivo como ASCII:
print "Olá mundo!\n";
  1. No CMD execute e veja o erro na impressão:
C:\> perl programa.pl
@erlimar
erlimar / hotsiteutils.js
Last active December 18, 2019 18:35
Hotsite utils
(function($){
"use strict";
/**
* jQuery "scrollTo" plugin
*/
$.fn.scrollTo = function(options) {
return this.each(function(){
var settings = $.extend({timeSleep: $.fn.scrollTo.defaults.timeSleep}, options );
var targetTop = this.offset().top;
@erlimar
erlimar / http_handler.rs
Last active August 28, 2019 21:20
Rust HTTP Server with hyper_rs
pub fn setup(router: &mut Router) -> CommonResult<()> {
router.add(Method::GET, "/".into(), Arc::new(protected_handler))
router.add(Method::POST, "/".into(), Arc::new(private_handler))
}
fn protected_handler(req: Request<Body>) -> Response<Body> {
match protected_guard(&req) {
Ok(_) => {
Response::builder()
.status(StatusCode::OK)
@erlimar
erlimar / index-time-a.html
Last active June 19, 2019 11:40
inspirationbsb-times
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Inspiration Lab Brasília - Cenário 1</title>
</head>
<body>
<button onclick="funcionalidadeA()">Funcionalidade A</button>
@erlimar
erlimar / hello.rs
Last active December 17, 2018 17:02
fn main() {
println!("Seja bem vindo Rustacean!");
}
@erlimar
erlimar / index.php
Last active August 7, 2018 17:39
Owip - Open Web Interface for PHP (baseado em http://owin.org)
<?php
$host = new Owip\Host\WebHostBuilder()
->useServer("Owip\Server\Basic")
->useContentRoot(__DIR__)
->useStartup("MyApp\Startup")
->build();
$host->run();
@erlimar
erlimar / business.go
Created March 22, 2018 20:59
E5R.Framework.Core #Models
type Blog {
Owner
Title
Url
}
type Post {
Date
Title
Author