Skip to content

Instantly share code, notes, and snippets.

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

Byurhan Nurula byurhannurula

🏠
Working from home
View GitHub Profile
@byurhannurula
byurhannurula / gist:8cccce3da9ae527358ea76f507b8e505
Created May 1, 2020 12:33 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
@byurhannurula
byurhannurula / animatedScrollTo.js
Created November 12, 2019 16:07 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
document.getElementsByTagName('button')[0].onclick = function () {
scrollTo(document.body, 0, 1250);
}
function scrollTo(element, to, duration) {
var start = element.scrollTop,
change = to - start,
currentTime = 0,
increment = 20;
@byurhannurula
byurhannurula / Repeat.js
Created October 15, 2019 14:58 — forked from mskoroglu/Repeat.js
react repeat component
/**
* usage:
* <ul>
* <Repeat times="3">
* <li>item</li>
* </Repeat>
* </ul>
* or
* <ul>
* <Repeat
@byurhannurula
byurhannurula / oneliners.js
Created April 28, 2019 14:22 — forked from ademilter/oneliners.js
👑 Awesome one-liners you might find useful while coding.
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.