Skip to content

Instantly share code, notes, and snippets.

View arafathusayn's full-sized avatar
👨‍💻
Focusing

Arafat Husayn arafathusayn

👨‍💻
Focusing
View GitHub Profile
@arafathusayn
arafathusayn / Emoji-on-Ubuntu.md
Last active May 17, 2024 08:27
Guide to enable system-wide Emoji support on Ubuntu 🤩

1. Install Fonts

sudo apt install fonts-noto-color-emoji

2. Add Font Configuration

  • Open ~/.config/fontconfig/conf.d/01-emoji.conf file in an editor.
  • Copy-paste the lines below:
@arafathusayn
arafathusayn / content_script.js
Last active May 14, 2024 12:49
Remove "Reels and short videos" from Facebook News Feed with less than 35 lines of JavaScript code. It works both on Desktop and Mobile web version of Facebook.
chrome ??= browser;
function removeReels(node) {
if (!node) return;
const bannedInnerTexts = ["Reels and short videos", "Reels"];
const text = node.querySelector(`div > span[dir="auto"]`)?.innerText ?? "";
const matchedOnDesktop = bannedInnerTexts.find((t) => t === text);
const matchedOnMobile = bannedInnerTexts.includes(
node.querySelector("div > span")?.innerText,
);
@arafathusayn
arafathusayn / removing_script.js
Last active May 8, 2024 03:33
Remove Tawk.to Branding (2022)
var removeBranding = function() {
try {
var element = document.querySelector("iframe[title*=chat]:nth-child(2)").contentDocument.querySelector(`a[class*=tawk-branding]`)
if (element) {
element.remove()
}
} catch (e) {}
}
@arafathusayn
arafathusayn / hidetidio.js
Last active May 7, 2024 23:42
Hide TidioChat Branding (for new theme)
function hideTdo() {
var timer = null;
var target = document.querySelector('#tidio-chat iframe');
if(!target) {
if(timer !== null) {
clearTimeout(timer);
}
timer = setTimeout(hideTdo, 500);
return;
} else {
@arafathusayn
arafathusayn / log.md
Created April 3, 2024 17:54
How I migrated my database from PlanetScale
@arafathusayn
arafathusayn / apt-install-chrome-deps.sh
Created September 8, 2020 15:23
Chromium Linux Dependencies
sudo apt install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
@arafathusayn
arafathusayn / script.sh
Created October 4, 2023 12:09
Temp Fix for `bun install some-package@latest`
echo 'void async function() { const p = await Bun.file("package.json").json(); const out1 = Object.entries(p.dependencies).filter(([k,v]) => v === "latest").map(([k]) => k).reduce((acc, curr) => acc + " " +curr, "bun add"); const out2 = Object.entries(p.devDependencies).filter(([k,v]) => v === "latest").map(([k]) => k).reduce((acc, curr) => acc + " " +curr, "bun add -d"); console.log(`\n${out1}\n\n${out2}\n`) }()' > temp.js && bun run temp.js; rm temp.js
#!/usr/bin/env python3
import argparse
import glob
import os
import struct
import sys
from sentencepiece import SentencePieceProcessor
HPARAMS = keys = ["vocab_size", "dim", "multiple_of", "n_heads", "n_layers"]
@arafathusayn
arafathusayn / useEffect_alternative_example.tsx
Last active March 18, 2023 12:46
useEffect alternative for functional React components
import * as React from "react";
import { useState } from "react";
import withCleanup from "./withCleanup";
import withOnMount from "./withOnMount";
let loaded = false;
function Counter() {
const [count, setCount] = useState(0);
@arafathusayn
arafathusayn / expo-typescript-eslint-prettier.md
Last active March 6, 2023 10:42 — forked from yovany-lg/expo-typescript-eslint-prettier.md
Setting up React Navite: Expo + Typescript + Eslint (Airbnb) + Prettier

Steps to get started with Expo, Typescript, ESLint and Prettier

The first step is to use the Expo CLI to initialize the project. If you don't have the latest version of the Expo CLI tool, (or you don't have it installed) run npm install -g expo-cli.

Now run the following commands in the same order:

  • expo init my-app -t expo-template-blank-typescript
  • npx install-peerdeps --dev eslint-config-airbnb
  • npm i --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
  • npm i --save-dev prettier eslint-config-prettier eslint-plugin-prettier

Create or edit the file .eslintrc.json with the following content: