Skip to content

Instantly share code, notes, and snippets.

View Mr-Jack82's full-sized avatar
πŸ’­
Learning to code

Π’ΠΈΡ‚Π°Π»ΠΈΠΉ Π¨Π΅Π²Ρ‡Π΅Π½ΠΊΠΎ Mr-Jack82

πŸ’­
Learning to code
  • Russia
View GitHub Profile
@Mr-Jack82
Mr-Jack82 / visually_hidden.css
Created February 14, 2026 12:08
Accessibility CSS snippet
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
margin: -1px;
border: 0;
padding: 0;
white-space: nowrap;
clip-path: inset(100%);
clip: rect(0 0 0 0);
@Mr-Jack82
Mr-Jack82 / normalize.css
Last active November 21, 2025 14:53
Reset default web browsers styles
/**
Нормализация Π±Π»ΠΎΡ‡Π½ΠΎΠΉ ΠΌΠΎΠ΄Π΅Π»ΠΈ
*/
*,
::before,
::after {
box-sizing: border-box;
}
/**
-- show cursor line only in active window
vim.api.nvim_create_autocmd({ "InsertLeave", "WinEnter" }, {
callback = function()
local ok, cl = pcall(vim.api.nvim_win_get_var, 0, "auto-cursorline")
if ok and cl then
vim.wo.cursorline = true
vim.api.nvim_win_del_var(0, "auto-cursorline")
end
end,
})
-- Fix conceallevel for json & help files
vim.api.nvim_create_autocmd({ "FileType" }, {
pattern = { "json", "jsonc" },
callback = function()
vim.wo.spell = false
vim.wo.conceallevel = 0
end,
})
@Mr-Jack82
Mr-Jack82 / autocmds.lua
Created November 19, 2023 20:04
Autocmd for auto save in Neovim like variant instead of use 907th/vim-auto-save
-- Taken from: https://github.com/LintaoAmons/CoolStuffes/blob/5b117d662f1f64e528545d584f5781f4522092c7/lazyvim/.config/nvim/lua/config/autocmds.lua#L5
-- HACK: Autosave
local function save()
local buf = vim.api.nvim_get_current_buf()
vim.api.nvim_buf_call(buf, function()
vim.cmd("silent! write")
end)
end
@Mr-Jack82
Mr-Jack82 / input_method.lua
Created November 19, 2023 16:53
Autocmd for Neovim to be able to change keyboard layout automatically
-- Take from here: https://github.com/LazyVim/LazyVim/discussions/1346
-- Auto change input method between Normal and Insert mode
vim.api.nvim_create_autocmd({ "InsertLeave" }, {
pattern = "*",
callback = function()
-- record the input method in Insert mode
local f_input = vim.fn.stdpath("state") .. "/last_input.tmp"
os.execute("im-select > " .. f_input)
-- switch back to `ABC` input method in Normal mode
@Mr-Jack82
Mr-Jack82 / inline_edit.lua
Created November 19, 2023 16:50
Allow edit for embedded languages like JavaScript in HTML in Neovim which do not support by default in the editor
-- That code taken from here:
-- https://github.com/dpetka2001/dotfiles/blob/3cd9413e1f32589b6bb7a090006f70677379d987/dot_config/nvim/lua/plugins/inline_edit.lua
return {
-- Plugin for editing <script> tags in html files in proxy buffer
-- which also provides support for correct attach `typescript` LSP
{
"AndrewRadev/inline_edit.vim",
lazy = true,
cmd = { "InlineEdit" },
keys = {
@Mr-Jack82
Mr-Jack82 / incline.lua
Created November 19, 2023 16:48
Floating statuslines for Neovim
-- Recipe taken from: https://github.com/LazyVim/LazyVim/discussions/1188
return {
"b0o/incline.nvim",
event = "BufReadPre",
enabled = true,
config = function()
local colors = require("tokyonight.colors").setup()
require("incline").setup({
highlight = {
groups = {
@Mr-Jack82
Mr-Jack82 / assign_map.lua
Created November 19, 2023 16:45
Some map fabric for Neovim usage
-- That snippet is used to assign mappings in neovim
local function map(modes, lhs, rhs, opts)
if type(modes) == "string" then
modes = { modes }
end
local keys = require("lazy.core.handler").handlers.keys
for _, mode in pairs(modes) do
if not keys.active[keys.parse({ lhs, mode = mode }).id] then
opts = opts or {}
opts.silent = opts.silent ~= false
# β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ minute (0 - 59)
# β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ hour (0 - 23)
# β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of month (1 - 31)
# β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ month (1 - 12)
# β”‚ β”‚ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€ day of week (0 - 6) (Sunday to Saturday;
# β”‚ β”‚ β”‚ β”‚ β”‚ 7 is also Sunday on some systems)
# β”‚ β”‚ β”‚ β”‚ β”‚
# β”‚ β”‚ β”‚ β”‚ β”‚
# * * * * * command_to_execute