Skip to content

Instantly share code, notes, and snippets.

View realamirhe's full-sized avatar
🧑‍🦯

Amir.H Ebrahimi realamirhe

🧑‍🦯
View GitHub Profile
@realamirhe
realamirhe / useUndoRedo.ts
Created October 28, 2021 13:33
undo redo react hook which don't cause re-render
import { useRef, useCallback } from 'react';
export const useUndoRedo = <T>() => {
const undoStack = useRef<T[]>([]);
const undoPointer = useRef(-1);
const add = useCallback((item: T) => {
const pointer = ++undoPointer.current;
undoStack.current.length = pointer;
undoStack.current[pointer] = item;
@realamirhe
realamirhe / flutter-installation.md
Last active October 5, 2021 17:55
Installing flutter in Ubuntu with sanctions

Installing flutter in Ubuntu with sanctions

  1. Install snap
  2. follow instruction of this youtube video

Notes:

install flutter with snap

@realamirhe
realamirhe / install Puppeteer with downloaded chrome-linux .md
Last active August 16, 2021 12:12
install puppteer with local chrome-linux installation file. (offline/without extra download)

When you install Puppeteer, it downloads a recent version of Chromium (~170MB Mac, ~282MB Linux, ~280MB Win) that is guaranteed to work with the API.

If you have chrome-linux.zip by chance here is instruction to get it into work

  1. PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn add puppeteer
  2. make a folder named .local-chromium in node_modules/puppeteer
  3. if you are in linux make another folder named linux-901912 in .local-chromium

version is the same as the version which you've downloaded chromimum e.g. in https://storage.googleapis.com/chromium-browser-snapshots/Linux_x64/901912/chrome-linux.zip

@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
@kevinSuttle
kevinSuttle / meta-tags.md
Last active July 10, 2024 09:39 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags