Skip to content

Instantly share code, notes, and snippets.

View sukhikh18's full-sized avatar
💪
Business, Development, Sales, Marketing

Nick Sergeevich sukhikh18

💪
Business, Development, Sales, Marketing
View GitHub Profile
@sukhikh18
sukhikh18 / gist:df8c74f8370cce2c1f4ad4cc29855e34
Created October 29, 2023 13:32
How to stop bluetooth on sleep in macbook m1?
brew install sleepwatcher blueutil
echo "$(which blueutil) -p 0" > ~/.sleep
echo "$(which blueutil) -p 1" > ~/.wakeup
chmod 755 ~/.sleep ~/.wakeup
brew services restart sleepwatcher
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
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": {
<?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
{
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
@sukhikh18
sukhikh18 / index.php
Created November 15, 2021 11:32
Проверить определение города по IP Bitrix
<?php
\Bitrix\Main\Service\GeoIp\Manager::getDataResult('127.0.0.1', LANGUAGE_ID)->getGeoData();
@sukhikh18
sukhikh18 / style.scss
Last active October 10, 2021 20:19
Grid row #Styles
.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));
@sukhikh18
sukhikh18 / for-find.sh
Created July 9, 2021 10:46
Применить команду к найденным файлам
for f in $(find /var/www/docker/nginx/conf.d/ -name *.conf.template); do echo $f; done
@sukhikh18
sukhikh18 / init.php
Created July 5, 2021 08:02
Добавить свойство в событие (письмо) #Bitrix
<?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'] : '';
});
@sukhikh18
sukhikh18 / findFile.php
Created June 30, 2021 08:10
Поиск включаемой области #Bitrix
<?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";