Skip to content

Instantly share code, notes, and snippets.

View iNewLegend's full-sized avatar
:octocat:

Leonid Vinikov iNewLegend

:octocat:
View GitHub Profile

Changelog

Version: 0.0.21 ~ 06/10/2026

  • New Features:
    • Pro: One paid plan, $4 a month, for servers that want more than two generators - Pro has no ceiling. It also lets a server give the bot its own name, avatar, banner and bio, which Discord applies in that server only. Free stays exactly what it was: two generators, every button, the interface editor and Events. Plans are bought, changed and cancelled from the dashboard's Subscription page, which says which plan a server is on, when it renews and, once cancelled, the date it drops back to free.
    • A 14 Day Free Trial: A server's owner can try Pro once, from the Subscription page, without paying. Two days before it ends the owner gets a direct message saying when, and what comes off - the custom look, and generators past the free two. Nothing else is needed at the end: the profile is taken off and the extra generators stop making rooms until somebody pays.
  • Events: A server's scheduled voice events get a check-in board ahead
@iNewLegend
iNewLegend / xxkernlink.sh
Created August 31, 2024 15:44
xxkernlink
@iNewLegend
iNewLegend / mongod-automated-replica-setup.cjs
Created August 24, 2024 15:25
MongoDB Automated Replica Setup As `systemd` Service
const { execSync } = require( 'child_process' );
const path = require( 'path' );
const fs = require( 'fs' );
const os = require( 'os' );
const homeUser = process.env.SUDO_USER || os.userInfo().username;
const homeDirectory = process.env.SUDO_USER ? path.join( '/home/', homeUser ) : os.homedir();
const DEFAULT_CONFIG_DIR = path.join( homeDirectory, 'replica_config' );
const DEFAULT_TEMPLATE_CONF_PATH = '/etc/mongod.conf';
@iNewLegend
iNewLegend / ui-template-base.ts
Last active May 1, 2023 11:43
Parse template
// Copyrights Leonid Vinikov <leonidvinikov@gmail.com>
export const UI_TEMPLATE_WRAPPER_START = "{",
UI_TEMPLATE_WRAPPER_END = "}";
export const uiUtilsWrapAsTemplate = ( template: string ): string => {
return UI_TEMPLATE_WRAPPER_START + template + UI_TEMPLATE_WRAPPER_END;
};
const UI_TEMPLATE_VAR_WRAPPER_REGEX = new RegExp( UI_TEMPLATE_WRAPPER_START + "(.+?)" + UI_TEMPLATE_WRAPPER_END, "g" );
@iNewLegend
iNewLegend / memory_leak.spec.tsx
Created February 25, 2023 12:43
Find memory leak in node example.
/**
* @author: Leonid Vinikov <leonidvinikov@gmail.com>
*/
import { Component } from "@internal/core/component";
import * as assert from "assert";
describe( 'Core', () => {
describe( 'Component', () => {
test( 'render() :: should have no memory leaks', async function () {
// Arrange.
<?php
// noinspection FallThroughInSwitchStatementJS
/*
- We have a NxN grid
- Turtle initial point is bottom left (1,1) looking north
- Turtle movement is one of: Forward one step (F), Turn left (L), Turn right (R).
- Grid has 4 directions: E/W/S/N.
_______________
| | | | |
/*
Binary search works on sorted arrays. Binary search begins by comparing an element in the middle of the array with the
target value. If the target value matches the element, its position in the array is returned. If the target value is less than
the element, the search continues in the lower half of the array.
*/
const array_1D = [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 ],
array_2D = [
[ 1, 2, 3 ],
[ 4, 5, 6 ],
<?php
/**
* @author Leonid Vinikov
* @version 1.0.3
*
* Created at: 2018-01-19
* Updated at: 2018-05-03
* Idea: https://github.com/jdorn/sql-formatter/blob/master/lib/SqlFormatter.php
* Updates:
* 2018-05-03 - grep added - version 1.0.1
@iNewLegend
iNewLegend / merge_json_recursive.php
Last active May 12, 2021 12:39
merge json recursive
<?php
function custom_merge_recursive( $original_schema, $schema_to_merge ) {
$get_value_by_path = function ( $path, $data ) {
$current = $data;
foreach ( $path as $key ) {
if ( ! isset( $current[ $key ] ) ) {
return null;
}
//-----------------------------------------------------------------------------------------------------------------------
// # Made by Leo123 (Leonid Vinikov)
// # mail : czf.leo123@gmail.com
//-----------------------------------------------------------------------------------------------------------------------
#include "stdafx.h"
#include "TApp.h"
//-----------------------------------------------------------------------------------------------------------------------
#define g_ModuleName "TApp"