Skip to content

Instantly share code, notes, and snippets.

View MichaelGitArt's full-sized avatar
🇺🇦
Learning

Michael MichaelGitArt

🇺🇦
Learning
View GitHub Profile
@MichaelGitArt
MichaelGitArt / utils-2.ts
Last active October 19, 2022 07:58
Composables
import LANGUAGES from '~/constants/languages'
export function formatDate(string: string) {
const dateArray = string.split('-')
const date = dateArray[2].slice(0, 1) === '0' ? dateArray[2].slice(1, 1) : dateArray[2]
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
return `${date} ${months[+dateArray[1] - 1]} ${dateArray[0]}`
}
Throttle execution of a function. Especially useful for rate limiting execution of handlers on events like resize and scroll.
<template>
<div
class="q-editor"
>
<div :id="holder" @change="onChange" />
</div>
</template>
<script>
import EditorJS from '@editorjs/editorjs'
@MichaelGitArt
MichaelGitArt / App.vue
Last active August 17, 2021 07:11
VuetifyDialog
<template>
<div>
<Component
:is="modal.component"
v-for="(modal, index) in dialogs"
:key="index"
:index="index"
v-bind="modal.props"
@close="onCloseModal(index)"
/>
@MichaelGitArt
MichaelGitArt / .eslintrc.js
Last active April 6, 2021 05:37
eslint-prettier
module.exports = {
rules: {
'no-unused-vars': ['warn'],
'vue/no-unused-components': ['warn'],
'vue/component-name-in-template-casing': [
'warn',
'PascalCase',
{
registeredComponentsOnly: false,
},
@MichaelGitArt
MichaelGitArt / debounce.js
Last active August 1, 2021 11:09
js-helper-functions
const debounce = (fn, ms) => {
let isCooldown = false
return function () {
if (isCooldown) {
return
}
// eslint-disable-next-line prefer-rest-params
fn.apply(this, arguments)
<template>
<!-- https://forum.vuejs.org/t/recursive-scoped-slots/8220/6?u=michaelgitart -->
<wrapper>
<b-table v-bind="$attrs" v-on="$listeners">
<!-- Pass on all named slots -->
<slot v-for="slot in Object.keys($slots)" :name="slot" :slot="slot"/>
<!-- Pass on all scoped slots -->
<template v-for="slot in Object.keys($scopedSlots)" :slot="slot" slot-scope="scope"><slot :name="slot" v-bind="scope"/></template>
// Включить автопроигрывание хедера
// ЧПУ нормальное
// Тест на телефоне
// Google Map
var map;
var markers = [];
var iconBasis = '/wp-content/themes/m1_template/img/icons/marker.png';