Hi guys 😁! Long time no new articles!
Today, I am going to show you how to compose React providers with TypeScript.
#! /bin/bash | |
# Salve este arquivo e não esqueça de dar permissão de execução: | |
# chmod +x ./git_log.sh | |
IFS=$'\n' | |
today=$(date '+%Y-%m-%d %H:%M:%S') | |
days=1 | |
projectsDir=$HOME/Projetos # Substitua pelo seu diretório de projetos ou use a flag -p para especificar outro diretório | |
username=$(git config user.name) |
echo "Starting..." | |
branch=$1 | |
delete() | |
{ | |
echo "Deleting branches..." | |
git branch --list | \ | |
egrep --invert-match "($branch|\*)" | \ | |
xargs git branch -D | |
echo "Done!" | |
} |
export const getScrolledParent = (el: HTMLElement | null): HTMLElement | null => { | |
if (el === null || el.parentElement === null) return null | |
if (el.parentElement.scrollTop > 0) return el.parentElement | |
return getScrolledParent(el.parentElement) | |
} |
-- Reset sequence to 1 | |
ALTER SEQUENCE table_name_id_seq RESTART WITH 1; | |
-- Fill all entries with sequence | |
UPDATE table_name SET id=DEFAULT; | |
-- Ref: https://stackoverflow.com/questions/4678110/how-to-reset-sequence-in-postgres-and-fill-id-column-with-new-data |
import React from 'react' | |
interface IComposeProvidersProps { | |
with: Array<React.ElementType> | |
children: React.ReactNode | |
} | |
export const ComposeProviders = ({ | |
with: Providers, | |
children, |
if you want to find out what files npm will publish into the tarball without actually publishing, you can use this little one-liner: | |
npm pack && tar -xvzf *.tgz && rm -rf package *.tgz | |
Found @ https://medium.com/@jdxcode/for-the-love-of-god-dont-use-npmignore-f93c08909d8d in 2022-03-27 |
import 'package:flutter/material.dart'; | |
void main() | |
{ | |
final TextEditingController _controller = new TextEditingController(); | |
var items = ['Working a lot harder', 'Being a lot smarter', 'Being a self-starter', 'Placed in charge of trading charter']; | |
runApp( | |
new MaterialApp( | |
title: 'Drop List Example', | |
home: new Scaffold( |
const range = (start = 0, end = 1) => Array.from({"length": (end + 1) - start}) | |
.map((_, i) => start + i); | |
console.log(range(-10, 10)); // [ -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] |
const range = (start = 0, end = 1) => Array.from({"length": (end + 1) - start}, (_, i) => start + i) | |
console.log(range(-10, 10)); // [ -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ] |