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
brew install sleepwatcher blueutil | |
echo "$(which blueutil) -p 0" > ~/.sleep | |
echo "$(which blueutil) -p 1" > ~/.wakeup | |
chmod 755 ~/.sleep ~/.wakeup | |
brew services restart sleepwatcher |
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
git fetch -p ; git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d |
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 {Fancybox} from "@fancyapps/ui"; | |
Fancybox.defaults = { | |
...Fancybox.defaults, | |
// more: 'share', 'download', 'thumbs', | |
buttons: ["zoom", "slideShow", "fullScreen", "close"], | |
lang: "ru", | |
i18n: { | |
...(Fancybox.defaults?.i18n || {}), | |
"ru": { |
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 | |
// Package symfony/mailer must be installed (`composer require symfony/mailer`) | |
require_once $_SERVER['DOCUMENT_ROOT'] . '/../vendor/autoload.php'; | |
use Symfony\Component\Mailer\Mailer; | |
use Symfony\Component\Mailer\Transport\SendmailTransport; | |
use Symfony\Component\Mime\Email; | |
class MailController | |
{ |
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
mysqldump -uadmin --password="admin" --no-tablespaces tablename > ./site-`date '+%Y%m%d'`.sql \ | |
--ignore-table=DATABASE.table1 | |
mysqldump -uadmin --password="***" --no-tablespaces app | gzip > ./site-`date '+%Y%m%d'`.sql.gz |
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 | |
\Bitrix\Main\Service\GeoIp\Manager::getDataResult('127.0.0.1', LANGUAGE_ID)->getGeoData(); |
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
.section { | |
--columns: 3; | |
--col-gap: 30px; | |
--col-gap-half: calc(var(--col-gap) / 2); | |
&__list { | |
display: flex; | |
flex-wrap: wrap; | |
margin-left: calc(-1 * var(--col-gap-half)); | |
margin-right: calc(-1 * var(--col-gap-half)); |
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
for f in $(find /var/www/docker/nginx/conf.d/ -name *.conf.template); do echo $f; done |
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 | |
use Bitrix\Main\EventManager; | |
$obEeventManager = EventManager::getInstance(); | |
$obEeventManager->addEventHandler("main", "OnBeforeEventSend", static function(&$arFields, &$arTemplate) { | |
$arFields['HTTP_REFERER_RAW'] = htmlspecialcharsEx($_SERVER["HTTP_REFERER"]); | |
$arFields['HTTP_REFERER'] = $arFields['HTTP_REFERER_RAW'] ? 'Отправленно со страницы: ' . $arFields['HTTP_REFERER_RAW'] : ''; | |
}); |
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 | |
if (!function_exists('findFile')): | |
function findFile($suffix = null, $recursive = true, $type = 'sect') { | |
global $APPLICATION; | |
$type = ("sect" !== $type) ? "page" : "sect"; // bx required sect | page | |
$suffix = strlen($suffix) > 0 ? $suffix : "inc"; | |
$recursive = in_array($recursive, array("N", false)) ? "N" : "Y"; |
NewerOlder