Skip to content

Instantly share code, notes, and snippets.

View Albus's full-sized avatar
🏠
Working from home

Anton Rastyazhenko Albus

🏠
Working from home
View GitHub Profile
@Albus
Albus / macos_nosleep.sh
Created January 11, 2021 11:30
Completely disable sleep on any Mac
# Useful to prevent Macbooks to go to sleep when closing the lid instead of running tools that requires a Kernel Extension (e.g. InsomniaX) and more
# Before doing anything, save your current configuration using
pmset -g
# To disable sleep
sudo pmset -a sleep 0; sudo pmset -a hibernatemode 0; sudo pmset -a disablesleep 1;
# And to go back to normal
sudo pmset -a sleep 1; sudo pmset -a hibernatemode [original hibernatemode value]; sudo pmset -a disablesleep 0;
// MIT License
// Copyright (c) 2019 Tsukanov Alexander
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
  1. Вызов стандартной обработки из любого пункта меню. Обработка "Поиск ссылок на объекты" достаточно удобна и может пригодиться обычным пользователям. Однако не всегда возможно давать им доступ к меню "Все функции" из-за ограниченного уровня доступа пользователя. В этом случае можно добавить вызов обработки из стандартного меню.

Добавляем в конфигурацию новую команду и в модуле команды прописываем текст:

&НаКлиенте
Процедура ОбработкаКоманды(ПараметрКоманды, ПараметрыВыполненияКоманды)
ПараметрКоманды, ПараметрыВыполненияКоманды)
    ПодключитьВнешнююОбработкуНаСервере();
    ОткрытьФорму("ВнешняяОбработка.StandardFindByRef.Форма");
КонецПроцедуры
@Albus
Albus / convert-xml-to-xpath.php
Created August 6, 2017 08:43 — forked from Divi/convert-xml-to-xpath.php
PHP: convert XML to XPath
<?php
// this function will show the full xpath of an XML file
// your code
$xml = new \SimpleXMLIterator('<root><node><foo bar="12">fooBar</foo><foo>bar</foo></node></root>');
$xpath = xmlToXPath($xml);
// the magic function
// from http://php.net/manual/fr/class.simplexmliterator.php#111916
@Albus
Albus / xdebug-cli.snippet
Created July 22, 2017 22:31 — forked from aminemat/xdebug-cli.snippet
enable xdebug in php-cli
export XDEBUG_CONFIG="idekey=PHPSTORM"
export PHP_IDE_CONFIG="serverName=cli"
;in php.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=HOST_IP
xdebug.remote_port=9000