Skip to content

Instantly share code, notes, and snippets.

[
{ "keys": ["alt+up"], "command": "move", "args": {"by": "pages", "forward": false} },
{ "keys": ["alt+down"], "command": "move", "args": {"by": "pages", "forward": true} },
{ "keys": ["alt+left"], "command": "move_to", "args": {"to": "bol", "extend": false} },
{ "keys": ["alt+right"], "command": "move_to", "args": {"to": "eol", "extend": false} },
{ "keys": ["ctrl+pagedown"], "command": "next_view_in_stack" },
{ "keys": ["ctrl+pageup"], "command": "prev_view_in_stack" },
@thedrint
thedrint / PhaserNestedContainerBug.js
Last active July 6, 2019 02:27
Example of bug in Phaser3 nested containers
var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
width: 640,
height: 480,
scene: {
create: create,
}
};
"use strict";
class Something {
constructor (settings) {
let {
someoption = 'Default something value',
anotheroption = 0,
} = settings;
// Need to autofill object by known key names
@thedrint
thedrint / init.php
Created August 21, 2017 11:42
Typical bitrix custom_mail function phpMailer and smtp (supports attaches)
function custom_mail ($to, $subject, $message, $additional_headers, $additional_parameters)
{
/*\AddMessage2Log(
'To: '.$to.PHP_EOL.
'Subject: '.$subject.PHP_EOL.
'Message: '.$message.PHP_EOL.
'Headers: '.$additional_headers.PHP_EOL.
'Params: '.$additional_parameters.PHP_EOL
);*/
@thedrint
thedrint / .settings.php
Created August 11, 2017 20:18
Default bitrix errors handling settings
'exception_handling' => array (
'value' => array (
'debug' => false,
'handled_errors_types' => E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE,
'exception_errors_types' => E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_USER_WARNING & ~E_USER_NOTICE & ~E_COMPILE_WARNING & ~E_DEPRECATED,
'ignore_silence' => false,
'assertion_throws_exception' => true,
'assertion_error_type' => 256,
'log' => array (
'settings' => array (
@thedrint
thedrint / list-unit-files.txt
Created March 13, 2017 19:30
Example of systemctl list-unit-files
UNIT FILE STATE
proc-sys-fs-binfmt_misc.automount static
org.freedesktop.hostname1.busname static
org.freedesktop.import1.busname static
org.freedesktop.locale1.busname static
org.freedesktop.login1.busname static
org.freedesktop.machine1.busname static
org.freedesktop.network1.busname static
org.freedesktop.resolve1.busname static
org.freedesktop.systemd1.busname static
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@thedrint
thedrint / deanon.php
Created November 28, 2016 21:32
Deanon image-script
<? require $_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/prolog_before.php';
file_put_contents($_SERVER['DOCUMENT_ROOT'].'/upload/gotcha2.log', date('d.m.Y H:i:s').PHP_EOL.print_r($_SERVER, 1).PHP_EOL, FILE_APPEND);
header( 'Content-Type: image/jpeg' );
echo file_get_contents($_SERVER['DOCUMENT_ROOT'].'/upload/iblock/000/0007b91a2a080008ab8dc986bdd50342.jpg');
die;
@thedrint
thedrint / example.c
Created November 4, 2016 20:39
Задачка на C
#include <iostream>
#include <cmath>
#include <stdio.h>
using namespace std;
int main() {
int a,b,c;
cout << "веди 3 числа" << endl;
cin >> a >> b >> c;
if (c < 0) {