This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PropsWithChildren, createContext, useContext, useMemo } from "react" | |
import { DocumentNode } from "@apollo/client" | |
import { getOperationName } from "@apollo/client/utilities" | |
import { groupBy } from "lodash-es" | |
type MutationQueryPair = { | |
mutation: DocumentNode | |
queries: DocumentNode[] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git-amend-old() ( | |
# Stash, apply to past commit, and rebase the current branch on to | |
of the result. | |
# For Gerrit. | |
https://stackoverflow.com/questions/1186535/how-to-modify-a-specified-commit/53$ | |
current_branch="$(git rev-parse --abbrev-ref HEAD)" | |
apply_to="$1" | |
git stash | |
git checkout "$apply_to" | |
git stash apply |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// minimum timeout | |
const BASE_HIDE_TIMEOUT = 3000 //ms | |
export const getFlashTimeout = (message: string) => { | |
const averageWordsPerSecond = 4 // average number of words per second a human can read | |
const amountOfWords = message.split(" ").length | |
const idealTimeout = (amountOfWords / averageWordsPerSecond) * 1000 | |
// factor in reading pauses for longer sentences | |
const factor = Math.floor(amountOfWords / 10) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fibRange = n => [...Array(n).keys()].reduce((acc) => acc.concat(acc.at(-1) + acc.at(-2)), [0,1]) | |
const fib = n => fibRange(n)[n] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CustomDropdown = () => { | |
const [isOpen, setIsOpen] = useState(false); | |
const handleBlur = e => { | |
const currentTarget = e.currentTarget; | |
setTimeout(() => { | |
if (!currentTarget.contains(document.activeElement)) { | |
setIsOpen(false); | |
} | |
}, 0); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Books: | |
Burkov, Andriy - The hundred-page machine learning book-Andriy Burkov (2019) | |
Aurélien Géron - Hands-On Machine Learning with Scikit-Learn and TensorFlow Concepts, Tools, and Techniques to Build Intelligent Systems-O’Reilly Media (2017) | |
Courses MOOC: | |
Deep Learning Specialization | |
https://www.coursera.org/learn/neural-networks-deep-learning | |
Deep Learning MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
JSON.stringify(Array.from(HTMLCollection).map((opcao) => ({ value: opcao.value, label: opcao.label}))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require("express"); | |
const router = express.Router(); | |
const passport = require("passport"); | |
// Multipart form data handler middleware | |
var multer = require("multer"); | |
var upload = multer({ dest: "uploads/" }); | |
const autoReap = require("multer-autoreap"); | |
// Cloudinary |
NewerOlder