This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function ApproveIt { | |
while true; do | |
echo | |
echo $1 | |
if [ ! "$2" == "" ] ; then echo $2 ; fi | |
echo | |
read -p "$3" yn | |
echo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyrights Leonid Vinikov <[email protected]> | |
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" ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author: Leonid Vinikov <[email protected]> | |
*/ | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. | |
_______________ | |
| | | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 ], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------------------------------------------------- | |
// # Made by Leo123 (Leonid Vinikov) | |
// # mail : [email protected] | |
//----------------------------------------------------------------------------------------------------------------------- | |
#include "stdafx.h" | |
#include "TApp.h" | |
//----------------------------------------------------------------------------------------------------------------------- | |
#define g_ModuleName "TApp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//----------------------------------------------------------------------------------------------------------------------- | |
// # Made by Leo123 (Leonid Vinikov) | |
// # mail : [email protected] | |
//----------------------------------------------------------------------------------------------------------------------- | |
#include "stdafx.h" | |
#include "TDataBase.h" | |
#include "Object.h" | |
//----------------------------------------------------------------------------------------------------------- |
NewerOlder