Skip to content

Instantly share code, notes, and snippets.

<?require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';?>
<?
\Bitrix\Main\Loader::includeModule('iblock');
$ar = array();
$arFilter = array(
'IBLOCK_ID' => IBLOCK_CAT_ID,
'ACTIVE' => 'Y'
<?require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';?>
<?
\Bitrix\Main\Loader::includeModule('iblock');
$ar = array();
$arSelect = array(
'ID',
'NAME',
<?require $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php';?>
<?
\Bitrix\Main\Loader::includeModule('iblock');
$ar = array();
$arFilter = array(
'IBLOCK_ID' => IBLOCK_REVIEWS_ID,
'ACTIVE' => 'Y',
@webmstk
webmstk / totp.rb
Last active December 14, 2016 10:57
class OneTimePasswordGenerator
def initialize(pass_code_length = 6)
@pin_modulo = 10 ** pass_code_length
end
def get_code(base64_secret, time = nil)
time = (Time.current.to_i / 30).floor unless time
secret = Base64.decode64 base64_secret
@webmstk
webmstk / totp.php
Last active December 14, 2016 10:55
<?
class OneTimePasswordGenerator {
static $PASS_CODE_LENGTH = 6;
static $PIN_MODULO;
public function __construct() {
self::$PIN_MODULO = pow(10, self::$PASS_CODE_LENGTH);
}
public function getCode($base64Secret, $time = null) {
if (!$time) {