Skip to content

Instantly share code, notes, and snippets.

View mirashif's full-sized avatar

Mir Ashif mirashif

View GitHub Profile
export default function isEmpty<T>(data: T): boolean {
if (Array.isArray(data)) return !data.length;
if (typeof data === "object" && data !== null)
return !Object.keys(data).length;
return !data;
}

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@mirashif
mirashif / package.json
Created November 7, 2022 11:26 — forked from jherr/package.json
Simple monorepo starter
{
"name": "packages",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"private": true,
"scripts": {
"start": "concurrently \"wsrun --parallel start\""
},
"workspaces": [
@mirashif
mirashif / .config
Last active February 14, 2023 21:25
How to set Oh My Posh theme
# windows bash
eval "$(oh-my-posh init bash --config ${POSH_THEMES_PATH}/uew.omp.json)"
# macos zsh
eval "$(oh-my-posh init zsh --config $(brew --prefix oh-my-posh)/themes/uew.omp.json)"
@mirashif
mirashif / css-reset.css
Created September 10, 2022 19:17
Resets default CSS rules set by the web browsers
html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
@mirashif
mirashif / toggle-virtualization.bat
Created July 16, 2022 13:39 — forked from jonpulsifer/toggle-virtualization.bat
Virtualization must be disabled to use CS:GO anti-cheat clients like FACEIT and ESEA, but I like to use WSL2 and Docker, and this script helps me do that
@echo off
echo Virtualization must be disabled to use anti-cheat clients like FACEIT and ESEA
echo.
net session >nul 2>&1
if %ERRORLEVEL% EQU 0 goto :chchchchoices
echo This script requires elevated privileges. Re-run as Administrator to continue
goto :exit
:chchchchoices
@mirashif
mirashif / react-native-setup.md
Created July 1, 2021 13:57
React native project initial setup process.

Initial project setup

  • Initialize expo app:
    expo init my-app
  • Template:
    blank typescript
  • Add strict tsconfig.json
    "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "jsx": "react-native",
@mirashif
mirashif / arrayFlat.js
Created June 10, 2021 14:40
Here is a quick way to flatten a deeply nested array in Javascript.
const nested = [1, 2, [3, 4, [5, 6, [7, 8, [9, 10]]]]];
const flatten = nested.flat(Infinity);
// [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
const result = flatten.join(", ");
// "1, 2, 3, 4, 5, 6, 7, 8, 9, 10"
@mirashif
mirashif / probhat.md
Last active May 3, 2023 14:12
Probhat unusual keyboard layout cheatsheet

স্বরবর্ণঃ

আ = v

ঈ = E

ঊ = W

ঋ = V

@mirashif
mirashif / typescript-basics.md
Created August 28, 2020 13:51
TypeScript basic syntax to get started building apps.

Types

let a: number,
  b: boolean,
  c: string,
  d: any,
  e: number[] = [1, 2, 3],
  f: any[] = [1, true, 'a', false];

Enumerated type