Skip to content

Instantly share code, notes, and snippets.

🦊

Vladislav Polyakov polRk

🦊
Block or report user

Report or block polRk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@polRk
polRk / findBestPlacement.js
Last active Oct 28, 2018
Find the best placement of buttons in columns. Viber richMessage (see example.ts)
View findBestPlacement.js
const findBestPlacement = (count) => {
const result = [4, 5, 6, 7].map(rows => ({
'Rows': rows,
'Columns': ((count / rows) ^ 0) === (count / rows) ? count / rows : (count / rows >> 0) + 1,
'Excess': count % rows,
'Free': count % rows === 0 ? 0 : rows - count % rows
}));
return [...result]
.filter((item) => {
@polRk
polRk / calendar.ts
Created Jun 8, 2019
Generate month days calendar on TypeScript and date-fns
View calendar.ts
import { isSameMonth, startOfMonth } from 'date-fns'
export const generateCalendar = (
firstDateOfMonth: Date
): number[][] => {
const date = startOfMonth(firstDateOfMonth)
const getDay = (date: Date) => {
let day = date.getDay()
if (day === 0) day = 7
@polRk
polRk / actions.ts
Last active Jun 23, 2019
Uon webhook actions
View actions.ts
/**
* Change manager in lead
{
datetime: '2019-06-23 08:38:19',
type_id: '29',
user_id: '2',
r_id: '1310',
old_manager_id: '2',
new_manager_id: '14'
@polRk
polRk / generate.js
Created Jul 8, 2019 — forked from dehamzah/generate.js
Generate secret key in NodeJS
View generate.js
require('crypto').randomBytes(32, function(err, buffer) { var token = buffer.toString('hex'); console.log(token); });
View vodnik.1000size.ru.lighthouse.report.json
{"lhrSlim":[{"id":"performance","title":"Performance","score":0.18},{"id":"accessibility","title":"Accessibility","description":"These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.","score":0.6,"manualDescription":"These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review)."},{"id":"best-practices","title":"Best Practices","score":0.62},{"id":"seo","title":"SEO","description":"These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).","score":0.98,"manualDescription":"Run these addi
View vodnik.1000size.ru.lighthouse.report.json
{"lhrSlim":[{"id":"performance","title":"Performance","score":0.2},{"id":"accessibility","title":"Accessibility","description":"These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.","score":0.6,"manualDescription":"These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review)."},{"id":"best-practices","title":"Best Practices","score":0.62},{"id":"seo","title":"SEO","description":"These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).","score":0.98,"manualDescription":"Run these addit
View vodnik.1000size.ru.lighthouse.report.json
{"lhrSlim":[{"id":"performance","title":"Performance","score":0.17},{"id":"accessibility","title":"Accessibility","description":"These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.","score":0.6,"manualDescription":"These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review)."},{"id":"best-practices","title":"Best Practices","score":0.62},{"id":"seo","title":"SEO","description":"These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).","score":0.98,"manualDescription":"Run these addi
View vodnik.1000size.ru.lighthouse.report.json
{"lhrSlim":[{"id":"performance","title":"Performance","score":0.18},{"id":"accessibility","title":"Accessibility","description":"These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.","score":0.6,"manualDescription":"These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review)."},{"id":"best-practices","title":"Best Practices","score":0.62},{"id":"seo","title":"SEO","description":"These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).","score":0.98,"manualDescription":"Run these addi
View vodnik.1000size.ru.lighthouse.report.json
{"lhrSlim":[{"id":"performance","title":"Performance","score":0.18},{"id":"accessibility","title":"Accessibility","description":"These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.","score":0.6,"manualDescription":"These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review)."},{"id":"best-practices","title":"Best Practices","score":0.62},{"id":"seo","title":"SEO","description":"These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).","score":0.98,"manualDescription":"Run these addi
View vodnik.1000size.ru.lighthouse.report.json
{"lhrSlim":[{"id":"performance","title":"Performance","score":0.18},{"id":"accessibility","title":"Accessibility","description":"These checks highlight opportunities to [improve the accessibility of your web app](https://developers.google.com/web/fundamentals/accessibility). Only a subset of accessibility issues can be automatically detected so manual testing is also encouraged.","score":0.6,"manualDescription":"These items address areas which an automated testing tool cannot cover. Learn more in our guide on [conducting an accessibility review](https://developers.google.com/web/fundamentals/accessibility/how-to-review)."},{"id":"best-practices","title":"Best Practices","score":0.62},{"id":"seo","title":"SEO","description":"These checks ensure that your page is optimized for search engine results ranking. There are additional factors Lighthouse does not check that may affect your search ranking. [Learn more](https://support.google.com/webmasters/answer/35769).","score":0.98,"manualDescription":"Run these addi
You can’t perform that action at this time.