Skip to content

Instantly share code, notes, and snippets.

View hipot's full-sized avatar
💭
someone still has to support legacy

Valerii Cheban hipot

💭
someone still has to support legacy
View GitHub Profile
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@maxsbelt
maxsbelt / gist:4476270
Last active August 5, 2024 02:44
BITRIX: Описание возможностей CMS 1C-Bitrix для создания файла описания параметров модуля options.php.
<?
$MODULE_ID = "Идентификатор модуля".
// -------------- СОХРАНЕНИЕ --------------
// ПО ОТДЕЛЬНОСТИ
foreach($arOptions as $arOption) {
__AdmSettingsSaveOption($MODULE_ID, $arOption);
}
@paul91
paul91 / pecl-memcached.sh
Created May 5, 2014 14:33
How to install php memcached on CentOS 6.5
#!/bin/bash
# How to install PHP memcached on CentOS 6.5
# Install dependencies
yum install cyrus-sasl-devel zlib-devel gcc-c++
# Get the latest libmemcached
wget https://launchpad.net/libmemcached/1.0/1.0.16/+download/libmemcached-1.0.16.tar.gz
tar -xvf libmemcached-1.0.16.tar.gz
@michael-baker
michael-baker / tune_ps2.ps1
Last active September 28, 2024 11:20
Apply an Intel XTU profile from PowerShell
# Must be run under 32-bit PowerShell as ProfilesApi is x86
[System.Reflection.Assembly]::LoadFrom("C:\Program Files (x86)\Intel\Intel(R) Extreme Tuning Utility\Client\ProfilesApi.dll") | Out-Null
# This script programmatically applies an Intel XTU profile.
# This script can replace the CLI method outlined here: https://www.reddit.com/r/Surface/comments/3vslko/change_cpu_voltage_offset_with_intel_xtu_on/
[ProfilesApi.XtuProfileReturnCode]$applyProfileResult = 0
$profileApi = [ProfilesApi.XtuProfiles]::new()
$profileApi.Initialize() | Out-Null
@IzzySoft
IzzySoft / ff57_addons.md
Last active October 14, 2024 18:54
Firefox 57+ Addon Compatibility / Replacements

Mozilla is doing it again: detering the addon developers who once made it „big“ (last time was when they forced them from XUL to their new „stable API“ for „long-time compatibility“ – which then proved to change as often as the XUL did before). So again, many of them are „jumping boat“, as they a) have no time to migrate to the new WebExtensions, b) WebExtensions don't offer the APIs required to perform the tasks needed by their addon, c) WebExtensions not even being ready yet (with just a couple of weeks left to the deadline, the API is still changing and far from being completed).

I won't start a rant on „if I wanted a browser that looks like Chrome (Aurora with FF29), behaves like Chrome (only signed addons via a central store), and now feels like Chrome, I'd use Chrome“. Of course that's true, and having to re-configure ~80% of the browser of course lets me consider changing to a different browser (certainly not Chrome, though). But first let's look where we stand (comments, additions and suggestions wel

@proweb
proweb / index.html
Last active October 15, 2024 21:13
Как разместить две формы Битрикс 24 на сайте.
<div id="my_container"></div> <!-- Form container -->
<!-- JS code from CRM Bitrix24 -->
<!-- Added "node" parametr -->
<script id="bx24_form_inline" data-skip-moving="true">
(function(w,d,u,b){w['Bitrix24FormObject']=b;w[b] = w[b] || function(){arguments[0].ref=u;
(w[b].forms=w[b].forms||[]).push(arguments[0])};
if(w[b]['forms']) return;
s=d.createElement('script');r=1*new Date();s.async=1;s.src=u+'?'+r;
h=d.getElementsByTagName('script')[0];h.parentNode.insertBefore(s,h);
})(window,document,'http://cp.silaev.bx/bitrix/js/crm/form_loader.js','b24form');
<?php
// Выводит список доступных иконок для меню
$arr = [
'fav_menu_icon',
'iblock_menu_icon_iblocks',
'fileman_menu_icon',
'clouds_menu_icon',
'iblock_menu_icon_types',
'smile_menu_icon',
@gdecider
gdecider / example_calling.php
Last active May 15, 2024 15:15
Битрикс Ш меню многоуровневое (простая разметка, рекурсивный вывод)
<? $APPLICATION->IncludeComponent("bitrix:menu", "menu-template", Array(
"ALLOW_MULTI_SELECT" => "N", // Разрешить несколько активных пунктов одновременно
"CHILD_MENU_TYPE" => "catalog", // Тип меню для остальных уровней
"DELAY" => "N", // Откладывать выполнение шаблона меню
"MAX_LEVEL" => "4", // Уровень вложенности меню
"MENU_CACHE_GET_VARS" => array( // Значимые переменные запроса
0 => "",
),
"MENU_CACHE_TIME" => "3600", // Время кеширования (сек.)
"MENU_CACHE_TYPE" => "N", // Тип кеширования
@in4in-dev
in4in-dev / perfect.php
Last active January 7, 2024 12:39
PHP VK audio unmask (decode extras)
<?php
//(js -> php) code. letter by letter
global $n, $i, $id;
$n = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/=";
$id = 12345; //YOUR USER ID
$i = [
'v' => function($e) {
return strrev($e);
@dkhorev
dkhorev / dkdev.mail.md
Last active February 17, 2022 16:51
Инструкция по расширению модуля dkdev.mail для Bitrix

Инструкция по расширению модуля dkdev.mail и dkdev.mailpro для Bitrix

Можно расширить функционал, добавив в корень модуля файлы addon_options.php (для админки) и addon_include.php (для рантайма). Эти изменения сохранится при обновлении базового модуля.

В файле addon_options.php нужно определить метод showAddonTab() который отвечает за рендер содержимого карточки.

В файле addon_include.php можно произвести любые действия и записать их в массив $result. Все содержимое этого массива будет включено в макросы письма.

Пример addon_options.php #1