Skip to content

Instantly share code, notes, and snippets.

View erkobridee's full-sized avatar

Erko Bridee erkobridee

View GitHub Profile
@erkobridee
erkobridee / App.tsx
Last active March 10, 2022 09:16
my way of use the react context effectively
import * as React from 'react';
import MyContextProvider from 'context/MyContext';
import MyApplication from 'domain/Application';
export const App: React.FunctionComponent = () => <MyContextProvider><MyApplication/></MyContextProvider>;
export default App;
@erkobridee
erkobridee / git_cleanup_merged_branches.sh
Created February 3, 2022 14:00
besides the defined list on the regex remove all other branches which were merged
git branch --merged | egrep -v "(^\*|master|main|staging|develop)" | xargs git branch -d
/*
useful references
regex pattern
https://github.com/mongodb/js-bson/blob/v4.2.0/src/objectid.ts#L9
validation function
https://github.com/mongodb/js-bson/blob/v4.2.0/src/objectid.ts#L301
/^([a-zA-Z0-9]{24}|[a-zA-Z0-9]{12})$/
@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