Skip to content

Instantly share code, notes, and snippets.

View alexandreaquiles's full-sized avatar

Alexandre Aquiles alexandreaquiles

View GitHub Profile
@rponte
rponte / Proposal.kt
Last active April 10, 2022 12:43
JPA and Hibernate: best way to mapping a primary key as UUID in MySQL 8.x
@Entity
class Proposal(
val name: String,
//
@Column(columnDefinition = "binary(16)") // this works but uses a MySQL's specific type
val customerId: UUID
) {
@Id
@GeneratedValue
@rponte
rponte / using-uuid-as-pk.md
Last active May 20, 2024 13:32
Não use UUID como PK nas tabelas do seu banco de dados

Pretende usar UUID como PK em vez de Int/BigInt no seu banco de dados? Pense novamente...

TL;TD

Não use UUID como PK nas tabelas do seu banco de dados.

Um pouco mais de detalhes

public class Main {
static class Node {
final Object car;
final Node cdr = this;
Node(Object content) {
this.car = content;
}
@dunossauro
dunossauro / jit.py
Last active August 17, 2020 14:19
cc
"""
$ pip install numba
$ python jit.py
resultados:
$ python test_cc.py
Tempos com JIT
cc_0_jit - Min: 0.15884569298941642, Max: 0.1812134649953805, Mean: 0.16276181136781814
cc_1_jit - Min: 0.15603229100815952, Max: 0.18515240401029587, Mean: 0.16477074182126672
cc_2_jit - Min: 0.1618276800145395, Max: 0.25311970300390385, Mean: 0.17394073442847002
@rponte
rponte / Intervalo_t.sql
Last active January 19, 2022 16:21
PL/SQL: exemplo de Objeto com estado e comportamentos no Oracle - Intervalo (Date Range)
--------------------------------------------------------
-- Representa um Intervalo de datas (Date Range)
-- https://docs.oracle.com/cd/B10501_01/appdev.920/a96624/10_objs.htm
--------------------------------------------------------
create or replace type Intervalo_t FORCE as Object (
inicio Date
,fim Date
-- Construtores
,Constructor Function Intervalo_t(inicio Date, fim Date) Return Self as Result
@Fazzani
Fazzani / free_m3u8.m3u
Created July 28, 2018 09:13
Free m3u8 streams
http://sample.vodobox.net/skate_phantom_flex_4k/skate_phantom_flex_4k.m3u8
http://playertest.longtailvideo.com/adaptive/wowzaid3/playlist.m3u8
http://cdn-fms.rbs.com.br/vod/hls_sample1_manifest.m3u8
http://nasatv-lh.akamaihd.net/i/NASA_101@319270/index_1000_av-p.m3u8?sd=10&rebase=on
http://content.jwplatform.com/manifests/vM7nH0Kl.m3u8
@fmasanori
fmasanori / super salários USP.py
Created July 4, 2017 23:27
Super Salários USP
"""
Autores:
Tiago Henrique da Cruz Pereira
João Felipe de Moraes Borges
"""
import threading
import time
import os
from urllib.request import urlopen
{
"language": {
"javascript": {
"linting.prefer": "JSHint",
"linting.usePreferredOnly": true
}
}
}
@rponte
rponte / Sorteio.java
Last active January 19, 2023 19:34
Algoritimos: Encontrar menor lance (valor) único em uma lista
import static java.util.Comparator.naturalOrder;
import static java.util.function.Function.identity;
import static java.util.stream.Collectors.counting;
import static java.util.stream.Collectors.groupingBy;
import java.util.stream.Collectors;
import java.util.stream.Comparator;
import java.util.*;
public class Sorteio {