Skip to content

Instantly share code, notes, and snippets.

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

Hamid Reza Nikoonia HamidReazaNikoonia

🏠
Working from home
View GitHub Profile
function testCall(a) {
fakeFetch(a)
.then((response) => {
if (a === 'works' && typeof response.data !== 'object') {
setState(fallbackRes)
return
}
@HamidReazaNikoonia
HamidReazaNikoonia / js-da-queue.js
Created February 18, 2022 05:59
JavaScript Data Structures - Queue
// Implement Queue in JS and store collection as Array ( use Array method for add and remove items )
class Queue {
constructor() {
this.collections = [];
}
enqueue(item) {
this.collections.push(item);
@HamidReazaNikoonia
HamidReazaNikoonia / gist:504dc1090fefad5c4079131c1b151669
Created December 2, 2021 02:56
How Controll UI Layout for LTR & RTL direction
// left-to-right
<html lang="en" dir="ltr">
// right-to-left
<html lang="ar" dir="rtl">
// Customize with CSS
html:lang(ar) {