Skip to content

Instantly share code, notes, and snippets.

View rashidtvmr's full-sized avatar
🏠
Working from home

Rashid rashidtvmr

🏠
Working from home
View GitHub Profile
@rashidtvmr
rashidtvmr / frontendDevlopmentBookmarks.md
Created March 4, 2025 16:05 — forked from dypsilon/frontendDevlopmentBookmarks.md
A badass list of frontend development resources I collected over time.
@rashidtvmr
rashidtvmr / easing.css
Created May 5, 2024 02:42 — forked from bendc/easing.css
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@rashidtvmr
rashidtvmr / what-forces-layout.md
Created March 29, 2024 08:59 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@rashidtvmr
rashidtvmr / Object.js
Created July 23, 2023 10:47
JS Cheatsheet
// 1. type of null is object
// 2. NaN is not equal to NaN ie NaN == NaN // false
// 3. Object.preventExtension prevent obj from adding keys
// 4. Object.isExtensible check for above config
// 5. Object.seal() apply step 3 and makes all of its properties unconfigurable i.e, they can’t be changed, anymore (except for their values): Read-only properties stay read-only, enumerable properties stay enumerable, etc
// 6. Object.freeze applies 3 and 5
// 7. Object.freeze is shallow this function frozes deeply
// 8. Shallow copy Object.assign, spread operator etc (Only own (non-inherited) properties are copied),
// 9. Many built-in objects have special “internal slots” that aren’t copied by object spreading #
// 10. Property attributes aren’t always copied
@rashidtvmr
rashidtvmr / useVideoGeneration.tsx
Created July 19, 2023 07:13
Images to Video Generation using WASM (React)
// @ts-nocheck
import { FFmpeg } from '@ffmpeg/ffmpeg';
import { useState, useEffect, useRef } from 'react';
const useVideoGeneration = ({
ffmpeg,
images,
audio,
slideDuration,
@rashidtvmr
rashidtvmr / useImagesConversion.tsx
Created July 19, 2023 07:07
useImageConversion
import { useState, useEffect } from 'react';
export default function useImagesConversion(images: any) {
const [imageBuffers, setImageBuffers] = useState<any>([]);
const [progress, setProgress] = useState(0);
const [error, setError] = useState<any>(null);
const [controller, setController] = useState<any>(null);
useEffect(() => {
// Create a new AbortController
@rashidtvmr
rashidtvmr / myclass.js
Created June 9, 2022 05:23 — forked from mvneerven/myclass.js
Using Events class
import { Events } from "./events";
export class MyClass {
events = new Events(this); // there we go!
constructor(data) {
await init();
}
/**
* Simplest event system for any class to implement
*/
export class Events {
constructor(host) {
this.proxy = document.createDocumentFragment();
this.proxy.host = host;
["addEventListener", "dispatchEvent", "removeEventListener"].forEach(
this.delegate,
@rashidtvmr
rashidtvmr / clipboard.md
Created June 7, 2022 08:16 — forked from krisleech/clipboard.md
3 ways to copy to clipboard in Javascript
if(document.queryCommandSupported('copy')) {
        if(text=='') { text = ' '; } // empty inputs do not get selected

        // copy text to off-screen input
        $('#clipboard').val(text);

        // 1.) does copy empty inputs, but adds newline before content
        var range = document.createRange();
 range.selectNode(document.querySelector('#clipboard'));
@rashidtvmr
rashidtvmr / setup.sh
Created July 8, 2021 15:19 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin