What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-11-21 14:40:31
code to convert rgb to hsl color
// see: https://en.wikipedia.org/wiki/RGB_color_model // see: https://en.wikipedia.org/wiki/HSL_and_HSV // expects R, G, B, Cmax and chroma to be in number interval [0, 1] // returns undefined if chroma is 0, or a number interval [0, 360] degrees functio... Add solution -
Javascript 2021-11-21 04:50:12
implement a merge sort algorithm JS
// Merge Sort Implentation (Recursive) function mergeSort (unsortedArray) { if (unsortedArray.length <= 1) { return unsortedArray; } const middle = Math.floor(unsortedArray.length / 2); const left = unsortedArray.slice(0, middle); co... Add solution -
Other 2021-11-21 02:42:13
make a time logger
let date_ob = new Date(); // current date // adjust 0 before single digit date let date = ("0" + date_ob.getDate()).slice(-2); // current month let month = ("0" + (date_ob.getMonth() + 1)).slice(-2); // current year let year = date_... Add solution -
Python 2021-11-20 22:26:12
python slice a dict
#python convert a dict to list or a list to dict or a slice a dict or sort a dict by key or value without import #convert dict to list or list to dict or slice a dict #1. convert dict to list temp = [] # not required as [] is mentioned below s = {'b': 3, ... Add solution