Just against ~~~newbies~~~ 95% of humanity :P
<script type="text/javascript" defer>
function devtoolIsOpening() {
console.clear();
let before = new Date().getTime();
debugger;
Ajouter l'extension eslint unused-imports
Séparer les config dans un autre répertoire pour + de lisibilité
Déplacer la partie Supabase de l'app => paquet. Ce projet le fait partiellement par exemple: https://github.com/jakubczarnowski/t3-turbo-template/blob/main/packages/validators/src/index.ts
Reproduire timebox.so
Publier le boilerplate sur github
import { useState, useCallback } from 'react' | |
import { AxiosPromise } from 'axios' | |
export interface ApiResponse<T> { | |
data?: T | undefined | |
error?: Error | undefined | |
loading: boolean | |
} | |
export type UseApiResponse<T> = [ApiResponse<T>, (...args: any[]) => Promise<void>, () => void] |
AD | Andorre AE | Émirats arabes unis AF | Afghanistan AG | Antigua-et-Barbuda AI | Anguilla AL | Albanie AM | Arménie AO | Angola AQ | Antarctique AR | Argentine
import React from 'react'; | |
import type { LayoutChangeEvent, Insets } from 'react-native'; | |
const defaultGetHitSlopForSize = ({ width, height }: Framesize): Insets => { | |
const x = width > 44 ? 0 : 10; | |
const y = height > 44 ? 0 : 10; | |
return { top: y, bottom: y, left: x, right: x }; | |
}; | |
type Framesize = { width: number; height: number }; |
/* | |
Demo: https://jsfiddle.net/elky/f6khaf2t/ | |
<div class="element"> | |
<div class="truncate"> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt | |
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco | |
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in | |
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat | |
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
import { useCallback, useState, useEffect } from 'react'; | |
const isBrowser = typeof window !== 'undefined'; | |
const getSize = () => { | |
if (isBrowser) { | |
return { | |
width: window.innerWidth, | |
height: window.innerHeight, | |
}; |
import { useCallback, useLayoutEffect, useRef } from 'react'; | |
const isBrowser = typeof window !== 'undefined'; | |
const getScrollPosition = ({ element, useWindow }) => { | |
if (!isBrowser) return { x: 0, y: 0 }; | |
if (useWindow) { | |
return { x: window.scrollX, y: window.scrollY }; | |
} |
import { useCallback, useEffect, useState, useMemo } from 'react'; | |
const isBrowser = typeof window !== 'undefined'; | |
const isLocalstorageAvailable = () => { | |
if (!isBrowser) { | |
return false; | |
} | |
const test = `test-${Date.now()}`; |
//manifest.json | |
{ | |
"name": "bookmark-search-export", | |
"version": "1.0", | |
"manifest_version": 2, | |
"description": "This extention will dump all bookmarks", | |
"browser_action": { | |
"default_icon": "icon.png" | |
}, | |
"background": { |