Skip to content

Instantly share code, notes, and snippets.

View xTCry's full-sized avatar
🦉
Power On

Vladislav Khr xTCry

🦉
Power On
View GitHub Profile
@dynax60
dynax60 / backup.sh
Created May 29, 2023 06:27
Simple site change tracker
#!/bin/bash
PATH=/usr/bin:/usr/sbin
# Установка переменных
SITE_DIRECTORY="/var/www/mysite.ru" # Путь к директории сайта
BACKUP_DIRECTORY="/opt/git/site" # Путь к директории для сохранения бэкапов
EMAIL_RECIPIENT="mysite@mysite.ru" # Адрес получателя электронной почты
MAX_DIFF_SIZE=$((10 * 1024)) # 10 Кб в байтах
# Создание временной директории для выполнения операций
@BluBb-mADe
BluBb-mADe / potato_patcher.py
Last active May 21, 2024 11:53
Generic Voicemeeter Potato in-memory patch
import os
import sys
import time
import subprocess
import traceback
from pymem import Pymem, process, exception
#############################################################################################
# This is an in-memory patch that launches and patches Voicemeeter Potato in memory on startup.
@gjreasoner
gjreasoner / README.md
Last active April 25, 2024 01:42
Expand Ubuntu 20 Proxmox Disk
# Resize the file system in UI, under VM -> Hardware -> Click on the disk to resize, click "Resize disk" button

# Confirm increase in disk space (1TB in my case)
$ lsblk
NAME                      MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda                         8:0    0    1T  0 disk
├─sda1                      8:1    0    1M  0 part
├─sda2                      8:2    0    1G  0 part /boot
└─sda3                      8:3    0    1T  0 part
@gullyn
gullyn / flappy.html
Last active May 4, 2024 15:35
Flappy bird in 205 bytes (improved!)
<body onload=z=c.getContext`2d`,setInterval(`c.width=W=150,Y<W&&P<Y&Y<P+E|9<p?z.fillText(S++${Y=`,9,9|z.fillRect(p`}*0,Y-=--M${Y+Y},P+E,9,W),P))):p=M=Y=S=6,p=p-6||(P=S%E,W)`,E=49) onclick=M=9><canvas id=c>
@negezor
negezor / bot.js
Last active February 3, 2021 21:00
Command prototype using Composition API for vk-io
const { VK } = require('vk-io');
const { Commander, useMessage, useViewer, onEnter, ref, watch } = require('./core');
const vk = new VK({
token: ''
});
const commander = new Commander();
@xTCry
xTCry / README.md
Last active May 6, 2020 14:42
Bitrix ShortCode baguetteBox.js or owl with swipebox Gallery

Bitrix ShortCode baguetteBox.js or OwlCarousel2 with swipebox Gallery

Простая галерея для Bitrix по shortCode из Инфоблока

Файлы

  • gallery.php должен находиться в дирректории /bitrix/templates/SITE_TEMPLATE_ID/component_handlers/
  • result_modifier.php должен быть в каждом шаблоне news.detail, где будут выводиться галереи

Использование

[gallery 000]

const crypto = require('crypto') //модуль для криптографии Nodejs
const { stringify } = require('querystring') //методы для парсинга строки
const url = require('url')
const URL =
'https://example.com/?vk_user_id=494075&vk_app_id=6736218&vk_is_app_user=1&vk_are_notifications_enabled=1&vk_language=ru&vk_access_token_settings=&vk_platform=android&sign=exTIBPYTrAKDTHLLm2AwJkmcVcvFCzQUNyoa6wAjvW6k',
CLIENT_SECRET = 'wvl68m4dR1UpLrVRli'
const checkVKQueryParamsSign = params => {
@micalevisk
micalevisk / .progress.
Last active August 31, 2023 00:01
📋 Reading List (updated at: 05/09/2022 22:13:43 [America/Manaus])
Articles █████████████▋░░░░░░░ 65.1%
Videos ██████████████████▌░░ 88.3%
Books ████████▋░░░░░░░░░░░░ 41.4%
Learn React ████████████░░░░░░░░░ 57.1%
Learn TypeScript █████████████████████ 100.0%
GitHub ████████████████▊░░░░ 80.0%
@xTCry
xTCry / README.md
Last active March 8, 2021 17:26
VK Widget date, weeks

VK Widget Недельности

Пример того, как получить год, день и т.д. из Unix time

Т.к. в Widgets group в ВК нету возможности в JS работать с Data, пришлось вот так извратиться

Недельность в группу

<?
class YoutubeVideo
{
function __construct($video)
{
$this->video = $video;
}
private function Prefix()