Skip to content

Instantly share code, notes, and snippets.

View rezaerami's full-sized avatar
💭
I love to code, I code to live;

Reza Erami rezaerami

💭
I love to code, I code to live;
  • Eltemate
  • Netherlands
View GitHub Profile
@rezaerami
rezaerami / sliderLogic
Created February 15, 2020 09:06
logic of updating parent and siblings
class SliderCore {
config = {};
sliderDots = null;
sliderArrow = null;
activeIndex = 0;
constructor(config){
this.setConfig(config);
this.initialize()
}
@rezaerami
rezaerami / CorruptedCoundtown.js
Last active June 23, 2021 17:15
this is a working countdown, but it has some issues
import React, { useState, useEffect } from "react";
import "./styles.css";
const Countdown = ({ dueDate }) => {
const [remaningTime, setRemaining] = useState();
console.log("re-render");
useEffect(() => {
setRemaining(getDateDiff(dueDate));
@rezaerami
rezaerami / Cartesian-Tree.js
Last active June 20, 2021 13:55
here is an implementation of Cartesian tree in Javascript
/**
* Creates a Node with value, lett and right children properties
* @param value
* @constructor
*/
function Node(value){
this.value = value;
this.right = undefined;
this.left = undefined;
}
@rezaerami
rezaerami / script.js
Last active September 18, 2023 15:44
Twitter auto report and blocker
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
(async () => {
document.querySelector('[data-testid="userActions"]').click();
await sleep(100);
const reportOption = Array.from(document.querySelector('[data-testid="Dropdown"]').children).find(child => child.textContent.includes("Report"));
reportOption.click();