Skip to content

Instantly share code, notes, and snippets.

View if0rest's full-sized avatar

Vladimir Khaprov if0rest

View GitHub Profile
@if0rest
if0rest / Bitrix: include init.php via GET-param.php
Last active April 5, 2021 11:32
Include init.php in Bitrix if GET-param set.
<?
if (isset($_GET['useinit']) && !empty($_GET['useinit']))
{
session_start();
$initStatus = strval($_GET['useinit']);
if ($initStatus == 'N')
{
if (isset($_SESSION['USE_INIT']))
@if0rest
if0rest / Bitrix: set page number for meta.php
Last active April 5, 2021 11:31
Set the page's number for metatag in Bitrix
<?
AddEventHandler('main', 'OnEpilog', array('CMainHandlers', 'OnEpilogHandler'));
class CMainHandlers
{
public static function OnEpilogHandler()
{
global $APPLICATION;
if (isset($_GET['PAGEN_1']) && intval($_GET['PAGEN_1']) > 0)
{
@if0rest
if0rest / Factoid.js
Last active April 5, 2021 11:17
Бегающие циферки
var show = true;
var countbox = ".factoid-block";
if ($(countbox).length) {
$(window).on("scroll resize", function() {
if (!show) return false;
var e_top = $(countbox).offset().top;
var w_height = $(window).height();
var e_height = $(countbox).outerHeight();
var w_top = $(window).scrollTop();
@if0rest
if0rest / install_xampp+bitrix
Last active December 18, 2019 11:37
Установка и настройка XAMPP на Linux + BItrix
Установка и настройка XAMPP
1. Скачать дистрибутив - https://www.apachefriends.org/download.html
2. Добавить флаг исполняемости:
chmod u+x ~/Загрузки/xampp-linux-x64-7.3.3-1-installer.run
3. Запустите от суперпользователя:
sudo ~/Загрузки/xampp-linux-x64-7.3.3-1-installer.run
4. Далее --> Галочка напротив XAMPP Core Files --> ...
5. В файле /opt/lampp/etc/httpd.conf раскомментировать строку:
Include etc/extra/httpd-vhosts.conf
@if0rest
if0rest / getRusDate.php
Last active April 5, 2021 10:55
[MODx] getRusDate | snippet
<?php
$dateNum = $scriptProperties['date'];
$fullDate = $scriptProperties['full'] ? true : false;
if (!$fullDate) {
$monthNum = substr($dateNum,5,2);
$rusMonth = array(
'01' => 'Январь',
'02' => 'Февраль',
'03' => 'Март',
@if0rest
if0rest / sublime_settings.json
Last active April 5, 2021 11:04
Sublime Settings
==================
Общие
==================
{
"binary_file_patterns":
[
"*.dds",
"*.eot",
"*.gif",
"*.ico",