Skip to content

Instantly share code, notes, and snippets.

View andrejsharapov's full-sized avatar
💻
Notebook ASUS & VSCode my love)

Andrej Sharapov andrejsharapov

💻
Notebook ASUS & VSCode my love)
View GitHub Profile
@andrejsharapov
andrejsharapov / spy.html
Last active April 28, 2025 08:43
Spy Maze Game
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Шпионский лабиринт v1.1.0</title>
<style>
body {
background-color: #222;
@andrejsharapov
andrejsharapov / extensions
Last active November 26, 2024 13:41
My VS Code extensions
Auto Close Tag
Auto Complete Tag
Auto Rename Tag
Babel JS
Batch Rename
Code Spell Checker + Russia
Color Highlight
Comments Anchor
@andrejsharapov
andrejsharapov / event-banner.js
Created September 18, 2024 09:20
vue save/read to localStorage (event-banner as v-snackbar)
export default {
data: () => ({
eventForClientBanner: true,
eventForClientDate: null,
}),
mounted() {
if (localStorage.eventForClientBanner) {
this.eventForClientBanner = JSON.parse(localStorage.getItem('eventForClientBanner'));
this.eventForClientDate = JSON.parse(localStorage.getItem('eventForClientDate'));
@andrejsharapov
andrejsharapov / html
Created September 17, 2024 07:24
vue component switcher
<template>
<v-card>
<div v-if="!currentTab">
...
</div>
<component v-else :is="currentTabComponent" />
</v-card>
<v-row class="d-flex align-center">
<v-col v-for="tab in games" :key="tab.name">
@andrejsharapov
andrejsharapov / eventTimer.js
Last active September 16, 2024 11:36
таймер обратного отсчета на js или moment.js с таймзоной
import moment from 'moment';
eventTimer() {
// const now = new Date();
// const start = new Date(this.info.recdatebegin);
// const end = new Date(this.info.recdateend);
// const diff = new Date(start.getTime() - now.getTime());
// const empty = new Date(0);
// const days = diff.getDate() - empty.getDate();
// const hours = diff.getHours() - empty.getHours();
@andrejsharapov
andrejsharapov / queries.sql
Created July 9, 2024 07:37
Elasticsearch - Kibana - Dev Tools
GET index/_search
{
"query": {
"match_all": {}
}
}
// by id
GET index/_doc/1
@andrejsharapov
andrejsharapov / getNoun.vue
Created June 20, 2024 08:06
Склонение слов
<template>
{{
getNoun(YourCount,
'комментарий',
'комментария',
'комментариев'
)
}}
</template>
@andrejsharapov
andrejsharapov / my-file.vue
Created May 17, 2024 07:13
Save states to localStorage (for Vue 2)
// change `nameState`
export default {
data: () => ({
nameState: 0,
}),
watch: {
nameState(state) {
localStorage.setItem('nameState', JSON.stringify(state));
},
},
@andrejsharapov
andrejsharapov / commentAnchors.tags.anchors.js
Last active April 22, 2024 13:28
vscode comment anchors taglist
// alphabet order
"commentAnchors.tags.anchors": {
// ANCHOR
"ANCHOR": {
"highlightColor": "#E4D832",
"iconColor": "#E4D832",
"scope": "file",
"styleComment": true
},
// NOTE
@andrejsharapov
andrejsharapov / array-objects-to-sub-arrays.js
Last active January 18, 2024 09:57
[ js]: внутри одного массива объединить объекты с общим значением в подмассивы
const array = [];
// inside one array, combine objects with a common value into sub arrays js
const arr = Object.values(
array.reduce((r, cur) => {
const key = 'k' + cur['code_importance_event'];
(r[key] = r[key] || []).push(cur);
return r;
}, {})