Skip to content

Instantly share code, notes, and snippets.

@danilo-teixeira
danilo-teixeira / falsehoods-programming-time-list.md
Created October 29, 2024 13:07 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@danilo-teixeira
danilo-teixeira / pt_br.affix
Created November 2, 2023 23:56 — forked from CauanCabral/pt_br.affix
Dicionários Hunspell PT-BR preparados para busca textual (FTS) com Postgresql. Fonte: https://cgit.freedesktop.org/libreoffice/dictionaries/tree/pt_BR
This file has been truncated, but you can view the full file.
SET UTF-8
TRY áàãâéêíóõôúüçesianrtolcdugmphbyfvkwjqxz
# VERO - Verificador Ortográfico Livre - Versão 3.2
# Copyright (C) 2006 - 2013 por Raimundo Santos Moura
# <[email protected]>
# Brasil - outubro 2013
# Este é um dicionário para correção ortográfica da língua Portuguesa
# para o Hunspell.
@danilo-teixeira
danilo-teixeira / UUIDv6.sql
Created October 23, 2023 19:10 — forked from fabiolimace/UUIDv6.sql
Functions for generating UUIDv6 and UUIDv7 on PostgreSQL
/*
* MIT License
*
* Copyright (c) 2023 Fabio Lima
*
* 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
@danilo-teixeira
danilo-teixeira / git_rebase.md
Created November 26, 2020 17:12 — forked from ravibhure/git_rebase.md
Git rebase from remote fork repo

In your local clone of your forked repository, you can add the original GitHub repository as a "remote". ("Remotes" are like nicknames for the URLs of repositories - origin is one, for example.) Then you can fetch all the branches from that upstream repository, and rebase your work to continue working on the upstream version. In terms of commands that might look like:

Add the remote, call it "upstream":

git remote add upstream https://github.com/whoever/whatever.git

Fetch all the branches of that remote into remote-tracking branches, such as upstream/master:

git fetch upstream

{
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
"devDependencies": {
"babel-jest": "<current-version>",
"babel-preset-env": "<current-version>",
"babel-preset-react": "<current-version>",
"jest": "<current-version>"
},
"scripts": {
"test": "jest"
}
function orderTotal(items) {
const minValueForFreeShipping = 100.00;
const shippingTotal = items.filter( item => item.shipping )
.reduce( (total, shipping) => total + shipping.value, 0 );
const productsTotal = items.filter( item => !item.shipping )
.reduce( (total, product) => {
const quantity = product.quantity || 1;
return total + (product.value * quantity);
}, 0 );
function orderTotal(items) {
return items.reduce( (total, product) => {
const quantity = product.quantity || 1;
return total + (product.value * quantity);
}, 0 );
}
export { orderTotal };
function orderTotal(items) {
return items.reduce( (total, product) => {
return total + product.value;
}, 0 );
}
export { orderTotal };
module.exports = {
"collectCoverageFrom": [
"src/**/*.{js,jsx,ts,tsx}",
"!src/**/*.d.ts"
],
"resolver": "jest-pnp-resolver",
"setupFiles": [
"react-app-polyfill/jsdom"
],
"testMatch": [