Skip to content

Instantly share code, notes, and snippets.

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

Artem Dubinin shoman4eg

🏠
Working from home
View GitHub Profile
#!/bin/sh
SHORTCUT="[Desktop Entry]
Name=Sublime Text 2
Comment=Edit text files
Exec=sublime
Icon=sublime_text.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Utility;TextEditor;"
<?php
include 'JSmin.php';
include 'CSSmin.php';
$sTemplatePath = $_SERVER['DOCUMENT_ROOT'] . 'Путь к шаблону';
function minify(array $arr) {
foreach ($arr as $orig => $minVersion) {
$pathInfo = pathinfo($orig);
<?php
/**
* @license
*
* PHP Error
*
* Copyright (c) 2012 Joseph Lenton
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@shoman4eg
shoman4eg / sqlTracker.php
Last active August 29, 2015 14:21
Bitrix Sql Tracker
<?php
$GLOBALS["DB"]->ShowSqlStat = true;
$application = \Bitrix\Main\Application::getInstance();
$connection = $application->getConnection();
$connection->startTracker();
$sqlTracker = $connection->getTracker();
?>
Какой то код c sql запросами
<? var_dump($sqlTracker->getQueries());
$GLOBALS["DB"]->ShowSqlStat = false;
<?php
namespace Newkaliningrad;
use Bitrix\Main\Data\Cache;
trait CacheTrait
{
protected $cacheTime = 3600;
protected $cachePath = '/datacache/';
protected $cacheVar = 'result';
<?php
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php");
$GLOBALS["DB"]->ShowSqlStat = true;
$application = \Bitrix\Main\Application::getInstance();
$connection = $application->getConnection();
$connection->startTracker();
$sqlTracker = $connection->getTracker();
// Сюда вставить sql запрос.
@shoman4eg
shoman4eg / cache.php
Last active November 23, 2017 07:21
Bitrix cache function from laravel
<?php
namespace Newkaliningrad\Tools;
use Bitrix\Main\Data\Cache as BxCache;
use Bitrix\Main\Type\DateTime;
use Closure;
class Cache
{
const CACHE_PATH = '/cache/path/';
@shoman4eg
shoman4eg / rc.lua
Created March 5, 2017 21:33
awesomewm
--[[
Awesome WM configuration template
--]]
-- {{{ Required libraries
local awesome, client, screen, tag = awesome, client, screen, tag
local ipairs, string, os, table, tostring, tonumber, type = ipairs, string, os, table, tostring, tonumber, type
local gears = require("gears")
local gdebug = require("gears.debug")
@shoman4eg
shoman4eg / footerasset.php
Created March 22, 2017 11:36
Bitrix js in footer
<?php
use Bitrix\Main\Page\Asset;
class FooterAsset
{
const LOCATION = 'FOOTER_LOCATION';
public static function addJs($src, $options = [])
{
@shoman4eg
shoman4eg / output.css
Last active July 9, 2018 16:22
Less space utilities
.mt-5 {
margin-top: 5px;
}
.mr-5 {
margin-right: 5px;
}
.mb-5 {
margin-bottom: 5px;
}
.ml-5 {