Skip to content

Instantly share code, notes, and snippets.

View erkobridee's full-sized avatar

Erko Bridee erkobridee

View GitHub Profile
@erkobridee
erkobridee / hexToHsl.js
Last active August 26, 2021 13:55
js transform hex color to hsl color
function hexToHSL(hex) {
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
let r = parseInt(result[1], 16);
let g = parseInt(result[2], 16);
let b = parseInt(result[3], 16);
(r /= 255), (g /= 255), (b /= 255);
let max = Math.max(r, g, b), min = Math.min(r, g, b);
let h, s, l = (max + min) / 2;

agile

user story

Why is the “As a… I want… So I…” format so effective?

It succinctly captures the who, what, and why of the organization’s need.

@erkobridee
erkobridee / building_react_library.md
Last active March 1, 2021 07:45
[JS][TS][NPM][GitHub Packages] how to create a library
@erkobridee
erkobridee / ms_azure_monitor.md
Last active February 16, 2021 11:28
useful information about MS Azure Monitor and Application Insights
@erkobridee
erkobridee / react_hook_useWait.ts
Last active April 27, 2020 09:51
safe way to use setTimeout or setInterval through react hooks
import * as React from 'react';
export enum JSTypeof {
UNDEFINED = 'undefined',
FUNCTION = 'function',
OBJECT = 'object',
STRING = 'string',
NUMBER = 'number',
}
@erkobridee
erkobridee / detect_location.js
Created February 25, 2020 09:27
detect user location
/*
version updated to use the fetch API
source:
https://github.com/AdeyinkaAdegbenro/Detect_Location/blob/master/detect_location.js
*/
function request(url) {
return fetch(url).then(response => response.json());
}
@erkobridee
erkobridee / gatsbyjs_ts-js_testing.md
Last active January 17, 2020 10:07
[gatsby testing] useful links #gastbyjs #js #testing