Skip to content

Instantly share code, notes, and snippets.

⚛️
Front-end Developer

Amer Lotfi Orimi amerllica

⚛️
Front-end Developer
Block or report user

Report or block amerllica

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View kalaam-e-Emam.js
const kE = x => `${x} باید ${x} باشد، ${x}ی که ${x} نباشد، ${x} نیست.`;
@amerllica
amerllica / shuffler.js
Created Jun 23, 2019
Simple array shuffler (Using reduce function)
View shuffler.js
const shuffler = array => array.reduce((accumulator, currentValue) => {
const randomIndex = Math.ceil(Math.random() * 10);
accumulator.splice(randomIndex, 0 ,currentValue);
return accumulator;
}, []);
@amerllica
amerllica / debounce.js
Last active Jun 3, 2019
JavaScript Debounce Function
View debounce.js
const searchInput = document.getElementById('search-input');
const searchText = document.getElementById('search-text');
const debounce = (func, wait = 100) => {
let timeout;
return (...args) => {
clearTimeout(timeout);
timeout = setTimeout(() => {
func.apply(this, args);
}, wait);
@amerllica
amerllica / EuclidTree.js
Last active Jun 3, 2019
The tree of Euclid
View EuclidTree.js
const euclidTree = (width = 100, height = 100) => {
const body = document.body;
const canvas = document.createElement('canvas');
canvas.width = width;
canvas.height = height;
body.appendChild(canvas);
const ctx = canvas.getContext("2d");
const branch = (size, angle) => {
size < 10 ? ctx.strokeRect(0, 0, size, size) : ctx.fillRect(0, 0, size, size);
if (size < 2) return;
You can’t perform that action at this time.