Skip to content

Instantly share code, notes, and snippets.

View anton-karlovskiy's full-sized avatar
🎯
Focusing

Anton Karlovskiy anton-karlovskiy

🎯
Focusing
View GitHub Profile

Approaches to developing in Vue/Nuxt.js

const STATUSES = Object.freeze({
IDLE: 'idle',
PENDING: 'pending',
SUCCESS: 'success',
FAILURE: 'failure'
});
const EVENT_TYPES = Object.freeze({
FETCH: 'FETCH',
CANCEL: 'CANCEL',
@anton-karlovskiy
anton-karlovskiy / links.md
Created November 3, 2020 14:26 — forked from addyosmani/links.md
this.performance links
@anton-karlovskiy
anton-karlovskiy / functional-utils.js
Created November 3, 2020 14:23 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)

Re: selfies project written in CRA and PWA

  • Planning of a project

    • The project planning is mostly based on Fullstack Project Planning.

      For most of my projects, especially recently, I've been following a planning process that helps me breakdown the project into component parts that help me build more efficiently.

  • React Project Structure

@anton-karlovskiy
anton-karlovskiy / blob-to-base64.js
Last active June 30, 2020 21:03 — forked from n1ru4l/index.js
Fetch blob and convert to base64
const fetchAsBlob = url => fetch(url).then(response => response.blob());
const convertBlobToBase64 = blob => new Promise((resolve, reject) => {
const reader = new FileReader();
reader.onerror = reject;
reader.onload = () => {
resolve(reader.result);
};
reader.readAsDataURL(blob);
});
@anton-karlovskiy
anton-karlovskiy / serialize-to-query-params.js
Last active July 12, 2020 20:50
How to create the query parameter string by combining a JS object
// RE: https://github.com/sindresorhus/query-string
// RE: https://bundlephobia.com/result?p=query-string@6.13.1
// RE: https://github.com/unshiftio/querystringify
// RE: https://github.com/Gozala/querystring
const serializeToQueryParams = (queryObject, prefix = '') => {
const queryString = [];
for (const key in queryObject)
if (queryObject.hasOwnProperty(key)) {
@anton-karlovskiy
anton-karlovskiy / workbox.md
Created May 28, 2020 09:53 — forked from addyosmani/workbox.md
Workbox recipes

Workbox runtime caching recipes

Your Service Worker script will need to import in Workbox and initialize it before calling any of the routes documented in this write-up, similar to the below:

importScripts('workbox-sw.prod.v1.3.0.js');
const workbox = new WorkboxSW();

// Placeholder array populated automatically by workboxBuild.injectManifest()