Skip to content

Instantly share code, notes, and snippets.

View wvovaw's full-sized avatar
👀
I don't blink anymore...

Vladimir Ivakhno wvovaw

👀
I don't blink anymore...
View GitHub Profile
{
"title": "JS Event Loop Basics",
"description": "Test your knowledge of the JavaScript event loop with these interactive tasks.",
"tasks": [
{
"id": "sync-vs-async",
"code": "console.log('A');\nsetTimeout(() => console.log('B'), 0);\nconsole.log('C');",
"answers": [
{ "id": "a", "text": "A, B, C" },
{ "id": "b", "text": "C, B, A" },
@wvovaw
wvovaw / keymap.json
Created February 4, 2026 12:51
My zed keymap preferences ~/.config/zed/keymap.json
// Zed keymap
// // For information on binding keys, see the Zed
// documentation: https://zed.dev/docs/key-bindings
//
// To see the default key bindings run `zed: Open Default Keymap`
// from the command palette.
[
{
"context": "Workspace",
"bindings": {
@wvovaw
wvovaw / .env
Last active January 27, 2026 16:07
Запуск стека новостника
# NODE_ENV=production
#
#### Web vars
PUBLIC_BASE_URL=http://localhost:80
STRAPI_URL=http://localhost:80/strapi # For static content
STRAPI_API_URL=http://cms:1337 # For api request at build time
# customize this
PUBLIC_BRAND=AdNow
PUBLIC_TARGET_LOCALE=en-US
@wvovaw
wvovaw / SKILL.md
Created January 22, 2026 11:29
Strapi REST API AI Skill
name strapi-rest
displayName Strapi REST API querying
description This skill provides comprehensive guidance for working with Strapi's REST API, including endpoint usage, authentication, querying parameters, and practical examples for content management.

Strapi REST API Skill

Prerequisites

@wvovaw
wvovaw / README.md
Last active February 7, 2024 13:47
Nuxt SSR friendly color theme switcher

Nuxt 3 + vueuse + Pinia SSR friendly color theme switcher

  1. Declare theme cookie in the app.vue.
  2. Use HTML nuxt builtin to bind data-theme attribute (your may differ) to the cookie.theme.
  3. Create theme.store.ts Pinia store. cycle function cycles through the list of modes and sets current state in the theme cookie
  4. Create ThemeSwitcher.vue component.

This approach is universal, SSR friendly and easy adoptable.

Read more about useColorMode

@wvovaw
wvovaw / Modal.vue
Created April 22, 2023 08:25
Nice responsive mobile-friendly modal window implementation with TailwindCSS and HeadlessUI (and some DaisyUI styles)
<script lang="ts" setup>
import {
Dialog as HDialog,
DialogPanel as HDialogPanel,
TransitionRoot as HTransitionRoot,
TransitionChild as HTransitionChild,
} from "@headlessui/vue";
const props = defineProps({
show: {
@wvovaw
wvovaw / nuxt_strapi.conf
Last active December 24, 2022 18:06
nuxt + strapi nginx proxy config
upstream strapi {
server 127.0.0.1:1337;
}
upstream nuxt {
server 127.0.0.1:3000;
}
server {
server_name www.domainname.com domainname.com;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
@wvovaw
wvovaw / utils.ts
Last active July 21, 2024 15:00
Some JS and TS code snippets that I need to use sometimes
// Generate random string
export const generateUID = (length: number) =>
Array(length)
.fill("")
.map((v) => Math.random().toString(36).charAt(2))
.join("");
// Convert ArrayBuffer to HEX string
export const bytesToHEX = (bytes: ArrayBuffer) =>
Array.from(new Uint8Array(bytes)).map(b => b.toString(16).padStart(2, '0')).join('');
@wvovaw
wvovaw / NASA original Mars rovers API.postman_collection.json
Created November 6, 2022 18:58
Original NASA Mars photos API schema for Perseverance and Curiosity rovers
{
"info": {
"_postman_id": "5be5d43b-8bce-418d-a8f8-9eb7a42c2911",
"name": "NASA original API",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "14509461"
},
"item": [
{
"name": "Mars2020,ingenuity",
@wvovaw
wvovaw / discord_install.sh
Last active June 25, 2024 17:18
Discord instalation script
#!/bin/env bash
# Ask a pass if not enough privileges
if (($EUID != 0)); then
if hash pkexec 2>/dev/null; then
pkexec "$0" "$@"
elif hash gksu 2>/dev/null; then
if [[ -t 1 ]]; then
sudo "$0" "$@"
else