Skip to content

Instantly share code, notes, and snippets.

View pastukh-dm's full-sized avatar

Dmytro Pastukh (Dima) pastukh-dm

View GitHub Profile
@pastukh-dm
pastukh-dm / import-github-labels.js
Last active December 17, 2020 16:24
Import GitHub labels
// Import GitHub labels
.forEach(function(label) {
addLabel(label)
})
function updateLabel (label) {
var flag = false;
[].slice.call(document.querySelectorAll(".labels-list-item"))
.forEach(function(element) {
if (element.querySelector('.label-link').textContent.trim() === label.name) {
flag = true
@pastukh-dm
pastukh-dm / export-github-labels.js
Last active December 17, 2020 16:24
Export GitHub labels
// Export GitHub labels
function componentFromStr(numStr, percent) {
var num = Math.max(0, parseInt(numStr, 10));
return percent ?
Math.floor(255 * Math.min(100, num) / 100) : Math.min(255, num);
}
function rgbToHex(rgb) {
var rgbRegex = /^rgb\(\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*,\s*(-?\d+)(%?)\s*\)$/;
var result, r, g, b, hex = "";
@PCreations
PCreations / rxjs-diagrams.md
Last active September 26, 2024 01:44
Super Intuitive Interactive Diagrams to learn combining RxJS sequences by Max NgWizard K
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active April 25, 2025 12:51
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@nblackburn
nblackburn / camelToKebab.js
Last active March 5, 2025 17:25
Convert a string from camel case to kebab case.
module.exports = (string) => {
return string.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2').toLowerCase();
};