Skip to content

Instantly share code, notes, and snippets.

View ildarkhasanshin's full-sized avatar
🚀
eat sleep code repeat

ildar r. khasanshin ildarkhasanshin

🚀
eat sleep code repeat
View GitHub Profile
<div id="timer_stock">
<span class="date_finish" style="display: none;" >2016-12-31</span>
<span class="days">00</span>
<span class="hours">00</span>
<span class="minutes">00</span>
<span class="seconds">00</span>
</div>
@ildarkhasanshin
ildarkhasanshin / JavaScript.sublime-build
Created September 29, 2016 16:14 — forked from corbanb/JavaScript.sublime-build
Sublime Text - Tools > Build System > New Build System
// Sublime Text - Build System for Javascript
{
"cmd": ["node", "$file"],
"selector": "source.js"
}
@ildarkhasanshin
ildarkhasanshin / report_admin.php
Last active October 25, 2016 06:39
report_admin
<?php
$path = htmlspecialchars($_REQUEST['path']);
$type = htmlspecialchars($_REQUEST['type']);
if (!empty($path)) {
switch ($type) {
case 'email':
$header = "Content-type:text/html; charset=\"utf-8\"\r\n";
$header .= "From: " . $_SERVER["SERVER_NAME"] . " <noreply@" . $_SERVER["SERVER_NAME"] . ">\r\n";
if (mail("email@gmail.com", $_SERVER["SERVER_NAME"] . '/report_admin.php', 'check url: ' . $path, $header)) {
header('Location: /');
<?php
require_once ($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
if ( !defined('B_PROLOG_INCLUDED') || B_PROLOG_INCLUDED !== true ) die();
define('NO_KEEP_STATISTIC', true);
CModule::IncludeModule('catalog');
CModule::IncludeModule('sale');
$arID = array();
$arBasketItems = array();
$dbBasketItems = CSaleBasket::GetList(
array(
<script src="//api-maps.yandex.ru/2.1/?lang=ru_RU" type="text/javascript"></script>
<script type="text/javascript">
ymaps.ready( function () {
var myMap = new ymaps.Map( 'map', {
center: [ 55.582335, 37.669342 ],
zoom: 16,
controls: [ "zoomControl" ]
}, {
searchControlProvider: 'yandex#search'
} ),
@ildarkhasanshin
ildarkhasanshin / popup.html
Last active January 30, 2018 20:12
popup
<style>
#bg-blackout {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.2);
z-index: 100;
}
@ildarkhasanshin
ildarkhasanshin / result_modifier.php
Last active November 4, 2016 13:43
bitrix | resize preview-picture via result_modifier.php
<?if (!defined("B_PROLOG_INCLUDED") || B_PROLOG_INCLUDED !== true) {
die();
}
foreach ($arResult["ITEMS"] as $key => $arElement) {
if (!empty($arElement["PREVIEW_PICTURE"]["SRC"])) {
$arFileTmp = CFile::ResizeImageGet(
$arElement["PREVIEW_PICTURE"],
array("width" => 100, "height" => 100),
BX_RESIZE_IMAGE_EXACT,
@ildarkhasanshin
ildarkhasanshin / bitrix settitle
Last active November 6, 2016 12:05
bitrix settitle
bitrix
settitle
@ildarkhasanshin
ildarkhasanshin / mysql_connect
Created November 20, 2016 13:55
mysql quick connect
<?php
$db_host = 'localhost';
$db_user = '';
$db_pass = '';
$db_name = '';
$db_table = '';
$db_field = '';
$link = mysql_connect($db_host, $db_user, $db_pass);
if (!$link) {
die(mysql_error());
@ildarkhasanshin
ildarkhasanshin / search_text_in_files.php
Last active May 16, 2017 13:16
search in text by php
<?php
function files_list($dir, &$files, $types_ar, $required_text) {
$fp = opendir($dir);
while ($file = readdir($fp)) {
$path = $dir . '/' . $file;
if (is_file($path)) {
if (in_array(end(explode('.', $file)), $types_ar)) {
$files[] = $path;
$contents = file_get_contents($path);
$pos = strpos($contents, $required_text);