Skip to content

Instantly share code, notes, and snippets.

@Dok11
Dok11 / Angular 6 HMR
Last active June 18, 2019 11:21
Angular 6. Instruction for HMR installation
`npm install --save-dev @angularclass/hmr`
`src/environments/environment.prod.ts`
Add rule: `hmr: false`
`src/environments/environment.ts`
Add rule: `hmr: true`
interface ColorRgb {
r: number;
g: number;
b: number;
}
interface ColorHsl {
h: number;
s: number;
l: number;
@Dok11
Dok11 / OpenDoor.cpp
Created February 21, 2019 17:52
UE4 APawn Bug
// Copyright Oleg Postoev
#include "OpenDoor.h"
#include "GameFramework/Actor.h"
// Sets default values for this component's properties
UOpenDoor::UOpenDoor()
{
// Set this component to be initialized when the game starts, and to be ticked every frame. You can turn these features
@Dok11
Dok11 / train.py
Last active September 14, 2019 21:53
Shared models for keras
import tensorflow as tf
from tensorflow.python.keras import Input, Model
from tensorflow.python.keras.layers import Conv2D, MaxPooling2D, Dropout, concatenate, \
Flatten, Dense
IMG_SHAPE = (60, 90, 1)
# Defined a shared model
shared_input = Input(IMG_SHAPE)
shared_layer = Conv2D(8, (7, 7), strides=3, input_shape=IMG_SHAPE, padding='valid', activation='relu')(shared_input)
@Dok11
Dok11 / (preview) Bitrix Classes Extending.php
Last active November 17, 2023 21:14
Bitrix Classes Extending
<?php
if (\Bitrix\Main\Loader::includeModule('iblock')) {
\Bitrix\Main\Loader::registerAutoLoadClasses(null, [
'CIBlockCMLImport' => __DIR__ . '/ciblockcmlimport.php',
]);
}
$pathToOriginalCode = $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/iblock/classes/general/cml2.php';
$originalCode = file_get_contents($pathToOriginalCode);
@Dok11
Dok11 / events.php
Created March 6, 2025 13:54
Bitrix. Визуальный рекдтор. Отключение авто установки ссылок для всех www-подобных текстов
AddEventHandler('fileman', 'OnBeforeHTMLEditorScriptRuns', 'disableAutoLinkHandler');
function disableAutoLinkHandler(): void
{
$js = "BX.addCustomEvent('OnEditorInitedBefore', (editor) => editor.config.autoLink = false);";
Asset::getInstance()->addString("<script>{$js}</script>", true);
}