This file contains 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
@echo off | |
chcp 65001 > nul | |
setlocal enabledelayedexpansion | |
:: Fetching the latest changes from the remote repository | |
git fetch --all | |
:: Switching to the master branch and getting the latest changes | |
git switch master | |
git reset --hard origin/master |
This file contains 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
@echo off | |
chcp 65001 > nul | |
setlocal enabledelayedexpansion | |
:: Fetching latest changes from remote repository | |
git fetch --all | |
:: Finding the latest release branch number | |
set latestReleaseNumber=0 | |
for /f "tokens=2 delims=-" %%j in ('git branch -r --list "origin/release-*"') do ( |
This file contains 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
# convert windows-1251 files to utf-8 in folder recursive. | |
# creates "_backup" folder with original files | |
# check if file is already encoded | |
for f in $(find . -name "*.css"); | |
do | |
if file --mime-encoding $f | grep -wqe "iso-8859-1" -e "unknown-8bit" | |
then | |
mkdir -p _backup/$(dirname ${f}) | |
cp $f ./_backup/$(dirname ${f}) |
This file contains 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
/** | |
* @return false|int Unix Timestamp первого сентября текущего учебного года | |
*/ | |
function EYearFDate() | |
{ | |
$format = 'd.m.Y'; | |
$EYearFDate = '01.09.' . date('Y'); | |
if (time() < strtotime($EYearFDate)) $EYearFDate = '01.09.' . (date('Y') - 1); | |
return strtotime($EYearFDate); |
This file contains 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
# convert video to telegram autoplay (not as file) | |
ffmpeg -i input.mp4 -c:v libx264 -crf 26 -vf scale=640:-1 out.mp4 | |
# convert vertical video to horizontal video with blur on both sides | |
ffmpeg \ | |
-i Sequence02.mpeg \ | |
-i Sequence02.mpeg \ | |
-filter_complex \ | |
"[0:v]scale=-1:720[scaled_video]; \ | |
[1:v]scale=1280:720,boxblur=16[blur_image];\ |
This file contains 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 | |
/** | |
* Возвращает отформатированный номер телефона, в виде 8 (987) 123-45-67 | |
* Если введено несколько номеров (через запятую и т.д.), разделяет результат. | |
* @param string $phone телефон (возможно несколько номеров через запятую, точку с запятой, слеш или перенос строки) | |
* @param string $delimiter разделитель результата при возврате ("<br/>" по-умолчанию) | |
*/ | |
function formatPhone($phone,$delimiter = '<br/>') { | |
$phone = str_replace(', ', ',', $phone); | |
$phone = str_replace('; ', ';', $phone); |
This file contains 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 | |
/* | |
* PHP: Recursively Backup Files & Folders to ZIP-File | |
* MIT-License - Copyright (c) 2012-2017 Marvin Menzerath | |
*/ | |
// Make sure the script can handle large folders/files | |
ini_set('max_execution_time', 600); | |
ini_set('memory_limit','1024M'); |
This file contains 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
server { | |
# Listen on port 81 | |
listen 81; | |
# Server name being used (exact name, wildcards or regular expression) | |
# server_name phpmyadmin.my; | |
root /usr/local/www/phpMyAdmin; |
This file contains 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
ssh_client_ip=`echo $SSH_CLIENT | awk '{ print $1}'`; | |
ipfw -q add 00431 allow tcp from $ssh_client_ip to me 3306 in via em0 keep-state |