tips to evolve as a developer
developers get stuck, paralized
https://www.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch04.html
Make It Stick https://www.amazon.com.br/Make-Stick-Science-Successful-Learning/dp/0674729013
function mapAsync<T, U>(array: T[], callbackfn: (value: T, index: number, array: T[]) => Promise<U>): Promise<U[]> { | |
return Promise.all(array.map(callbackfn)); | |
} | |
async function filterAsync<T>(array: T[], callbackfn: (value: T, index: number, array: T[]) => Promise<boolean>): Promise<T[]> { | |
const filterMap = await mapAsync(array, callbackfn); | |
return array.filter((value, index) => filterMap[index]); | |
} |
import { ThemeType } from 'some/path/to/my/tokens'; | |
import 'styled-components'; | |
declare module 'styled-components' { | |
export interface DefaultTheme extends ThemeType {} | |
} |
<!-- | |
Smoothie sliding up toast animation | |
Entering: "ease-out duration-300 transition transform" | |
From: "opacity-0 translate-y-2 sm:translate-y-0 sm:translate-x-2" | |
To: "opacity-100 translate-y-0 sm:translate-x-0" | |
Leaving: "ease-in-out duration-300 transition-all transform" | |
onExit: node => node.style.maxHeight = node.getBoundingClientRect().height | |
From: "opacity-100 opacity-100 mb-5 translate-y-0 sm:translate-x-0" | |
onExiting={node => node.style.maxHeight = ''} |
# Not everything is defined here, just what was mentioned in the article | |
type User { | |
id: ID! | |
name: String! | |
avatar: Image! | |
isPro: Boolean! | |
viewerHasFollowed: Boolean! | |
shots(exclude: ID): ShotConnection! | |
} |
// copy this massive script in your console on the github page where the calendar is shown | |
// copy this massive script in your console on the github page where the calendar is shown | |
// copy this massive script in your console on the github page where the calendar is shown | |
// threejs.org/license | |
(function(k,ua){"object"===typeof exports&&"undefined"!==typeof module?ua(exports):"function"===typeof define&&define.amd?define(["exports"],ua):(k=k||self,ua(k.THREE={}))})(this,function(k){function ua(){}function v(a,b){this.x=a||0;this.y=b||0}function ya(){this.elements=[1,0,0,0,1,0,0,0,1];0<arguments.length&&console.error("THREE.Matrix3: the constructor no longer reads arguments. use .set() instead.")}function W(a,b,c,d,e,f,g,h,l,m){Object.defineProperty(this,"id",{value:ej++});this.uuid=O.generateUUID(); | |
this.name="";this.image=void 0!==a?a:W.DEFAULT_IMAGE;this.mipmaps=[];this.mapping=void 0!==b?b:W.DEFAULT_MAPPING;this.wrapS=void 0!==c?c:1001;this.wrapT=void 0!==d?d:1001;this.magFilter=void 0!==e?e:1006;this.mi |
tips to evolve as a developer
developers get stuck, paralized
https://www.oreilly.com/library/view/apprenticeship-patterns/9780596806842/ch04.html
Make It Stick https://www.amazon.com.br/Make-Stick-Science-Successful-Learning/dp/0674729013
import React, { useState, useEffect } from 'react'; | |
import { useField, FieldHookConfig, FieldInputProps, FieldMetaProps, FieldHelperProps } from 'formik'; | |
import { useDebouncedCallback } from 'use-debounce'; | |
const DEBOUNCE_DELAY = 300; | |
export function useFastField<Val = any>( | |
propsOrFieldName: string | FieldHookConfig<Val>, | |
): [FieldInputProps<Val>, FieldMetaProps<Val>, FieldHelperProps<Val>] { | |
const [field, meta, helpers] = useField<Val>(propsOrFieldName); |
import React, { useContext, useCallback } from 'react'; | |
export const FeatureFlagContext = React.createContext<string[]>([]); | |
export const useFeatureFlag = () => { | |
const features = useContext<string[]>(FeatureFlagContext); | |
const hasFeature = useCallback( | |
(feature: string) => { | |
return features.includes(feature); |
export const getCurl = (fetch) => (...args) => { | |
const [url, options] = args; | |
const { method, headers = {}, body = {} } = options; | |
const curl = [ | |
`curl -X ${method}`, | |
`"${url}"`, | |
...Object.keys(headers) | |
.filter((headerKey) => headers[headerKey] != null) | |
.map((headerKey) => `-H '${headerKey}: ${transformHeader(headers[headerKey])}'`), |
High Performance Configuration for Jetbrains IDEs [IntelliJ, WebStorm, etc..]
Once you step into the realm of multi-project development, large scale dev, or just have to have like 6 IDE's open. You really start to feel a performance hit on jetbrains IDEs.
This configuration aims to give at least 10x performance increases across the board.