Skip to content

Instantly share code, notes, and snippets.

View artemsites's full-sized avatar

Artem Kuznecov artemsites

View GitHub Profile
  let tags = ['TITLE', 'META', 'SCRIPT', 'HEAD', 'LINK', 'STYLE']
  document.querySelectorAll('*').forEach(function(node) {
    if (!tags.includes(node.tagName)) {
      if (window.getComputedStyle(node).display === 'none' || window.getComputedStyle(node).visibility === 'hidden') {
          console.log(node)
          node.style.display = 'block';
          node.style.visibility = 'visible';
          node.style.border = '3px solid red';
 node.style.position = 'fixed';

Закрыть доступ к дирректории от клиента (браузера)

RedirectMatch 404 ^/(.*)node_modules/(.*)\$

Удалить dependencies, не требуемые другими пакетами

pamac remove -o

Install package

sudo pacman -Syu <package_name>

Remove package with dependencies

sudo pacman -Rs <package_name>

ВАЖНО!!!

  1. Перед публикацией в .env выключить
APP_DEBUG=1   

и выключить

APP_ENV=dev 

и включить

Как использовать более новую версию php в териминале сервера?

php8.3  

Как использовать composer более новой версии php в терминале сервера?

php8.3 $(which ~/.local/bin/composer)

Найти крайнюю (последнюю) цифру в строке (javascript)

let str = "+7 (123) ___-__-__"
let pos = str.search(/.(?=[^\d]*$)/)
// pos === 6

Regex на валидность пароля (javascript)

import { mount } from "@vue/test-utils"
import { describe, expect, test, it } from 'vitest'

import InputSelect from './input-select.vue'

describe('InputSelect', () => {
  it('renders properly', async () => {