Skip to content

Instantly share code, notes, and snippets.

View Chagall's full-sized avatar
:electron:
42

Fábio Alves Martins Pereira Chagall

:electron:
42
View GitHub Profile
@alexbruno
alexbruno / valid.cnpj.ts
Last active April 23, 2024 13:02
Validação de CNPJ
// Regex para validação de string no formato CNPJ
export const regexCNPJ = /^\d{2}.\d{3}.\d{3}\/\d{4}-\d{2}$/
// Método de validação
// Referência: https://pt.wikipedia.org/wiki/Cadastro_Nacional_da_Pessoa_Jur%C3%ADdica
export function validCNPJ(value: string | number | number[] = '') {
if (!value) return false
// Aceita receber o valor como string, número ou array com todos os dígitos
const isString = typeof value === 'string'
@wojteklu
wojteklu / clean_code.md
Last active May 8, 2024 19:42
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@aiworld
aiworld / deep_drive_model.prototxt
Last active August 10, 2021 06:03
DeepDrive - Vision model that drives in GTAV
name: "GTANet"
# Can be used with pretrained Caffenet (AlexNet architecture).
# Layers with names containing 'gtanet' are not transferred from Caffenet.
layer {
name: "gta_frames_input_layer"
type: "HDF5Data"
top: "images"
top: "targets"