Skip to content

Instantly share code, notes, and snippets.

View olehmelnyk's full-sized avatar
👻

Oleh Melnyk olehmelnyk

👻
  • Lviv, Ukraine
View GitHub Profile
@olehmelnyk
olehmelnyk / pantone.js
Created December 30, 2017 17:44
get HEX/RGB/CMYK by Pantone code (parse official Pantone website search result)
// get HEX/RGB/CMYK by Pantone code (parse official Pantone website search result)
async function pantone(pantoneCode){
pantoneCode = pantoneCode // validate input:
.trim()
.replace(/^PANTONE /i, '') // we don't need 'PANTONE ' here
.replace(/ /g, '-'); // no spaces
return fetch(`https://www.pantone.com/color-finder/${pantoneCode}`)
.then(response => response.text())
.then(doc => new DOMParser().parseFromString(doc, 'text/html'))
@olehmelnyk
olehmelnyk / rgbToPantone.js
Created December 30, 2017 17:47
Parsing 3rd party website for RGB to Pantone
/**
* Parsing 3rd party website
* not sure how accurate/valid/outdated it is
* and this resource might be closed any time
* but https://github.com/teelaunch/pms-pantone-color-chart
* uses this site here https://github.com/teelaunch/pms-pantone-color-chart/blob/master/pantone.js#L9
* */
async function rgbToPantone(RGB){
return fetch(`http://www.netfront.fr/Services/rgb2pantone/pantone.htm?r=${RGB[0]}&g=${RGB[1]}&b=${RGB[2]}`)
.then(resolve => resolve.text())
@olehmelnyk
olehmelnyk / pasteToBroserConsole.js
Created December 30, 2017 17:49
Parse from search result, manually, browser-only
/**
Parse from search result, manually, browser-only
go to
https://store.pantone.com/eu/en/colorfinder/index/search/q/#ffffff
or
https://store.pantone.com/eu/en/colorfinder/index/search/q/black
where the last param is hex color or color name
up to 100 pantone colors will be returned there
@olehmelnyk
olehmelnyk / robots
Last active February 7, 2018 00:16
рОбота vs робОта для RGVoice "Анатоль"
{винайшли,винахідники,розробили,розробники,створили,творці,у,я,виконувати} робот{a,у,и,ів} {зможуть,зможе,можуть,може,будуть,буде,вміє,навчиться,розпізнає,розпізнавати,впізнає,впізнавати,знаходить,знаходити,оприділяє,оприділяти,допомагає,допомагати,охороняє,охороняти,приносить,приносити,працювати,працбє}/1
{шукаю,потрібна,ведеться,виконую,здійснюю,вашу,нашу,без,на,в,з} робот{а,у,и,і}/2
// приклади перевірки
В майбутньому вашу роботу будуть виконувати роботи.
Я робот, а ви залишитесь без роботи!
Роботи зможуть виконувати вашу роботу швидше і якісніше, а головне - дешевше!
Чим зайнятись коли робот пішов на роботу?
потрібна робота
ведеться робота
@olehmelnyk
olehmelnyk / gist:bf84fc9cfddc75e46acd3d6e839f48a9
Last active February 6, 2018 19:30
наголоси з https://ukr-mova.in.ua/library/nagolos - не всі працюють правильно, певно я чогось не знаю або допустився певних помилок
ветеринарія/4
новий/2
спина/1
випадок/1
олень/1
граблі/2
кидати/1
курятина/1
локшина/1
одинадцять/3
@olehmelnyk
olehmelnyk / webpack.config.js
Last active May 2, 2018 12:23
Webpack - Open Chrome w/ dev env
const path = require('path');
const webpack = require('webpack');
const htmlWebpackPlugin = require('html-webpack-plugin');
const browserPlugin = require('webpack-browser-plugin');
const chromeUserDataDir = `C:\\Chrome dev session`;
module.exports = {
context: path.resolve(__dirname, 'src'),
entry: './index.js',
The Moon
The Sun
The Earth
10 interesting facts about the Moon
The dark side of the moon is a myth.
In reality both sides of the Moon see the same amount of sunlight however only one face of the Moon is ever seen from Earth. This is because the Moon rotates around on its own axis in exactly the same time it takes to orbit the Earth, meaning the same side is always facing the Earth. The side facing away from Earth has only been seen by the human eye from spacecraft.
The rise and fall of the tides on Earth is caused by the Moon.
@olehmelnyk
olehmelnyk / calendar-v4.markdown
Last active November 25, 2018 15:26
Calendar-v4
#target indesign;
#targetengine 'myCustomGetFileNameHandler';
if (app.activeDocument && app.activeDocument.name) {
var underscoreIndex = app.activeDocument.name.indexOf("_");
if (underscoreIndex !== -1) {
var fileNameVariable = app.activeDocument.name.slice(0, ++underscoreIndex); // get XXXXX_ from XXXXX_Name1_Name2_Name3.indd file name
function grepClearSearchFields() {
https://scoop.sh/
scoop bucket add nerd-fonts