This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { transports, format, createLogger } from 'winston'; | |
| import { errorLogger } from 'express-winston'; | |
| const myFormat = format.printf(({ timestamp, level, message }) => { | |
| return `${timestamp} [${level}]: ${message}`; | |
| }); | |
| export const winstonErrorLogger = errorLogger({ | |
| transports: [ | |
| new transports.Console() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # # Функция для установки Git | |
| # install_git() { | |
| # echo "Обновление списка пакетов..." | |
| # sudo apt-get update | |
| # echo "Установка Git..." | |
| # sudo apt-get install -y git | |
| # echo "Git успешно установлен." | |
| # } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import random | |
| import json | |
| import os | |
| import sys | |
| # Файл для хранения ранее использованных портов | |
| PORTS_FILE = 'used_ports.json' | |
| MIN_PORT = 10024 | |
| MAX_PORT = 60000 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="ru"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Тетрис с бонусами</title> | |
| <style> | |
| body { | |
| font-family: Arial, sans-serif; | |
| text-align: center; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias d='docker compose up -d' | |
| alias ds='docker compose stop' | |
| alias dd='docker compose down' | |
| alias du='docker compose up' | |
| alias dbu='docker compose up -d --build' | |
| alias dr='docker compose stop && docker compose up -d --force-recreate' | |
| alias dl='docker compose logs -f' | |
| alias dc='docker compose' | |
| alias de='docker exec -it' | |
| alias dp='docker system prune' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #cloud-config | |
| autoinstall: | |
| version: 1 | |
| source: | |
| id: ubuntu-server-minimal | |
| search_drivers: false | |
| user-data: | |
| package_update: false | |
| package_upgrade: false | |
| timezone: Europe/Moscow |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * The custom permalinks to the posts. | |
| * | |
| * @param string $post_link The post's permalink. | |
| * @param WP_Post|int $post The post in question. | |
| * @param bool $leavename Whether to keep the post name. | |
| * | |
| * @return string | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # This is for Ubuntu 22.04 | |
| # set -euo pipefail | |
| ######################## | |
| ### SCRIPT VARIABLES ### | |
| ######################## | |
| ### Be non-root user w/ sudo privileges. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Setup development environment by manipulating plugin activation | |
| * Replace the dev URLs and plugin paths accordingly | |
| */ | |
| function mysite_development_environment_setup() { | |
| // define the development sites | |
| $dev_envs = array( | |
| 'http://localhost:8888', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //defer css | |
| function add_rel_preload($html, $handle, $href, $media) { | |
| if (is_admin()) | |
| return $html; | |
| $html = <<<EOT | |
| <link defer="defer" rel='stylesheet' href='$href' media="print" onload="this.media='all'" id='$handle' crossorigin="anonymous"/> |
NewerOlder