Skip to content

Instantly share code, notes, and snippets.

View jackblackjack's full-sized avatar
💭
IT про нос!

Aleksey Chugarev jackblackjack

💭
IT про нос!
  • Moscow, Russia
View GitHub Profile
/* JSON Editor v0.7.28 - JSON Schema -> HTML Editor
* By Jeremy Dorn - https://github.com/jdorn/json-editor/
* Released under the MIT license
*
* Date: 2016-08-07
*/
/**
* See README.md for requirements and usage info
*/
@jackblackjack
jackblackjack / axiosInterceptor.js
Created February 6, 2023 00:17 — forked from nzvtrk/axiosInterceptor.js
Axios create/recreate cookie session in node.js enviroment
/* Basic example of saving cookie using axios in node.js and session's recreation after expiration.
* We have to getting/saving cookie manually because WithCredential axios param use XHR and doesn't work in node.js
* Also, this example supports parallel request and send only one create session request.
* */
const BASE_URL = "https://google.com";
// Init instance of axios which works with BASE_URL
const axiosInstance = axios.create({ baseURL: BASE_URL });
@jackblackjack
jackblackjack / .bashrc
Created January 30, 2022 07:20 — forked from marioBonales/.bashrc
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@jackblackjack
jackblackjack / gist:31da83c60f37a81ff157095812a45fd7
Created September 7, 2021 23:06 — forked from chad3814/gist:2924672
deleting array items in javascript with forEach() and splice()
// This is from my comment here: http://wolfram.kriesing.de/blog/index.php/2008/javascript-remove-element-from-array/comment-page-2#comment-466561
/*
* How to delete items from an Array in JavaScript, an exhaustive guide
*/
// DON'T use the delete operator, it leaves a hole in the array:
var arr = [4, 5, 6];
delete arr[1]; // arr now: [4, undefined, 6]
@jackblackjack
jackblackjack / Emitter.ts
Created August 17, 2021 19:17 — forked from ternavsky/Emitter.ts
Typescript Event Bus
import IEvent from "IEvent";
import IEventListener from "IEventListener";
export class EventEmitter
{
private listeners: { [key: string]: IEventListener[] } = {};
public on(event: Function, listener: IEventListener): void
{
if (!this.listeners[event.name]) this.listeners[event.name] = [];
@jackblackjack
jackblackjack / settings.json
Last active September 15, 2021 01:12
vscode settings.json
{
"editor.fontSize": 11.5,
"git.autofetch": true,
"git.enableSmartCommit": true,
"breadcrumbs.enabled": true,
"editor.renderIndentGuides": false,
"code-runner.saveFileBeforeRun": true,
"code-runner.saveAllFilesBeforeRun": true,
"workbench.activityBar.visible": true,
"files.trimTrailingWhitespace": true,

Standalone applications

There are several ways of mounting a Nest application. You can create a web app, a microservice or just a bare Nest standalone application (without any network listeners). The Nest standalone application is a wrapper around the Nest IoC container, which holds all instantiated classes. We can obtain a reference to any existing instance from within any imported module directly using the standalone application object. Thus, you can take advantage of the Nest framework anywhere, including, for example, scripted CRON jobs. You can even build a CLI on top of it.

Getting started

To create a Nest standalone application, use the following construction:

@@filename()
@jackblackjack
jackblackjack / bitrix-stuff
Created June 2, 2021 14:18 — forked from dkhorev/bitrix-stuff
Фишки битрикс
Уже давно не работаю с битрикс, сохраняю на память
Как сделать фильтр по возрасту для CUser::GetList ?
$stmp_1 = (new \DateTime())->modify('-18 year')->getTimestamp();
$stmp_2 = (new \DateTime())->modify('-16 year')->getTimestamp();
$filter = Array(
"PERSONAL_BIRTHDAY_1" => ConvertTimeStamp($stmp_1, 'SHORT'),
"PERSONAL_BIRTHDAY_2" => ConvertTimeStamp($stmp_2, 'SHORT')
@jackblackjack
jackblackjack / update.php
Created June 2, 2021 13:23 — forked from Ginnw2/update.php
Обновление свойства элемента Bitrix
<?//обновление свойства элемента
$result = \Bitrix\Iblock\ElementPropertyTable::update(
$arProp[ID],// ID в таблице
[
'IBLOCK_PROPERTY_ID'=>50, // ID свойства
'VALUE'=>$arProp['VALUE'] // новое значение свойства
]);
?>
@jackblackjack
jackblackjack / gist:a05025be31270c4f8c460f093a728752
Created June 2, 2021 13:23 — forked from Ginnw2/gist:88bb697ff0d99a8b817edb0c7592a04e
Массовое создание свойств инфоблоков
<?$resB = CIBlock::GetList(
Array(),
Array(
'TYPE'=>'catalog'
), false
);
while($ar_res_blo = $resB->Fetch())
{
$iblon[] = $ar_res_blo['ID'];
}