Skip to content
View jebarjonet's full-sized avatar
👋
👋

Block or report jebarjonet

Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse

Pinned Loading

  1. Transforms a country code (ISO 3166-... Transforms a country code (ISO 3166-1 alpha-2) into corresponding flag emoji
    1
    import { toUpper } from 'lodash'
    2
    
                  
    3
    export const codeToFlag = (code: string): string =>
    4
      String.fromCodePoint(
    5
        ...toUpper(code)
  2. Time needed for a human to read a te... Time needed for a human to read a text (in ms)
    1
    import { max, words } from 'lodash'
    2
    
                  
    3
    export const readingTime = (text) => {
    4
        const wordsPerMinute = 280
    5
        const computedTime = (words(text).length * 60000) / wordsPerMinute
  3. Memoized function accepting argument... Memoized function accepting arguments (prevents React rerendering)
    1
    import memoize from 'memoizee'
    2
    
                  
    3
    /**
    4
     * Returns memoized function accepting arguments (prevents React rerendering)
    5
     */