Skip to content

Instantly share code, notes, and snippets.

var cont = document.getElementsByTagName('head')[0];
var jsList = [
{src: '/static/inner/js/libs.js', async: true, defer: true},
{src: '/local/templates/inner/assets-prog/dist/script.min.js', async: true, defer: true},
{
src: 'https://maps.googleapis.com/maps/api/js?libraries=places&key=YOUR_API_KEY',
onLoad: function () {
setTimeout(function () {
$(window).trigger('google:map:ready');
<?
$arUrlRewrite = array(
array(
"CONDITION" => "~^/personal/projects/requests/(\\d+)/(\\?.*|\$)(?#__rule_sort_hack__)~",
"RULE" => "id=\$1",
"ID" => "",
"PATH" => "/personal/projects/requests/detail.php",
"SORT" => 100,
),
array(
<?php
// Выводит список доступных иконок для меню
$arr = [
'fav_menu_icon',
'iblock_menu_icon_iblocks',
'fileman_menu_icon',
'clouds_menu_icon',
'iblock_menu_icon_types',
'smile_menu_icon',
find . -name \*.jpg -type f -exec jpegoptim --strip-all {} \;
find . -name \*.png -type f -exec optipng -o7 {} \;
@geff21st
geff21st / .htaccess
Last active September 8, 2017 03:15
# Removes index.php from ExpressionEngine URLs
RewriteCond %{REQUEST_URI} !^/bitrix/
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [L,NE,R] # <- for test, for prod use [L,NE,R=301]
# Adds trailing slashes
RewriteCond %{REQUEST_URI} !^/bitrix/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /$1/ [L,NE,R] # <- for test, for prod use [L,NE,R=301]
<?
defined("B_PROLOG_INCLUDED") && B_PROLOG_INCLUDED === true || die();
if (!Bitrix\Main\Loader::includeModule("iblock")) return;
/**
* Когда нужно выводить элементы и получать из них разделы
* @source: https://gist.github.com/geff21st/fbf0abeb5422678e4622ccc288a10dac
* @global CMain $APPLICATION
* @var array $arParams
* @var array $arResult
*/
<?
if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) die();
/**
* @global CMain $APPLICATION
* @var array $arParams
* @var array $arResult
*/
[alias]
pll = !git pull origin `git rev-parse --abbrev-ref HEAD`
psh = !git pll && git push origin `git rev-parse --abbrev-ref HEAD`
upd = !git add . && git stash && git pull origin `git rev-parse --abbrev-ref HEAD` && git stash pop && git stash clear && git status
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
<?
define('LOG_FILENAME', __DIR__.'/log/'.date('Ymd').'.log');
require_once($_SERVER["DOCUMENT_ROOT"].'/bitrix/modules/main/include/prolog_before.php');
?>
<? foreach ($arResult["ITEMS"] as $arItem): ?>
<?
$this->AddEditAction(
$arItem["ID"], $arItem["EDIT_LINK"],