Skip to content

Instantly share code, notes, and snippets.

View realamirhe's full-sized avatar
👓

Amir.H Ebrahimi realamirhe

👓
View GitHub Profile
@realamirhe
realamirhe / postgres_colab.md
Last active November 26, 2022 19:00
Setup postgres in goolge colab

Copy and paste each block of code to your colab notebook and run them all so you can save data in your postgres database and query (retierive) data from it.

Setup

%%bash
# Install postgresql server
sudo apt-get -y -qq update
sudo apt-get -y -qq install postgresql
@realamirhe
realamirhe / discord-crawler.js
Created December 27, 2022 08:30
Crawl discord images and text
window.discordRef = Object.keys(window.discordRef).length ? window.discordRef : {};
function debounceEvent(callback, time) {
let interval;
return () => {
clearTimeout(interval);
interval = setTimeout(() => {
interval = null;
@realamirhe
realamirhe / Z.tsx
Last active March 14, 2024 08:46
Conditional Render in jsx
/* eslint-disable @typescript-eslint/no-explicit-any */
import {
ReactNode,
RefAttributes,
cloneElement,
createElement,
isValidElement,
} from 'react';
export default function Z() {