This file contains hidden or 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
/* Одним из недостатков шаблона FactoryMethod является необходимость создания отдельного Creator'а для каждого Product'а. | |
Данный подход позволяет использовать GenericCreator для создания любого Product'а.*/ | |
/// | |
/// This is base class (super class) for FactoryMethod | |
/// | |
internal abstract class FactoryMethodCreatorBase | |
{ | |
public abstract FactoryMethodProductBase FactoryMethod(); |
This file contains hidden or 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
/// <summary> | |
/// Преобразует значение ячейки DataTable'а в указанный тип или возвращает значение по умолчанию, если в ящейке нет данных (DBNull) | |
/// </summary> | |
/// <typeparam name="T">Целевой тип, должен реализовывать IConvertible</typeparam> | |
/// <param name="value">Значение ячейки</param> | |
/// <param name="defaultValue">Значение по умолчанию</param> | |
public static T GetValue<T>(object value, T defaultValue) | |
where T : IConvertible | |
{ | |
if (Convert.IsDBNull(value)) |
This file contains hidden or 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 | |
# SSH/SCP Sync | |
# use in this way: | |
# bash sync.sh '/c/Git/Project/forder-for-sync/*' '10.0.0.10' '/home/username/forder-for-sync/' '/c/sshKeys/key.pem' | |
args=("$@") | |
SRCFOLDER=${args[0]} # '/c/Git/Project/forder-for-sync/*' | |
TRGHOST=${args[1]} # '10.0.0.10' |
This file contains hidden or 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
// 0m - WHITE ON BLACK | |
// 32m GREEN | |
console.log( '\x1b[0m\x1b[32m%s\x1b[0m %s\x1b[0m', message1, message2 ); | |
// 31m - RED | |
console.log( '\x1b[0m\x1b[31mRed Message\x1b[0m %s\x1b[0m', message ); |
This file contains hidden or 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
REM will start the specified virtual machine in the background. | |
REM To shut it down, request the shut down from the guest. | |
C:\Program Files\Oracle\VirtualBox\VBoxManage startvm $VM --type headless | |
REM enable symlinks on shared folders | |
C:\Program Files\Oracle\VirtualBox\VBoxManage setextradata YOUR_VM_NAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOUR_SHAR_EFOLDER_NAME 1 | |
# Install Video at Ubuntu (Fix SCREEN Resolution) | |
sudo apt-get install virtualbox-guest-utils virtualbox-guest-x11 virtualbox-guest-dkms |
This file contains hidden or 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
-------------------------------------------------- | |
How to return objects wich contains empty array? | |
https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax | |
[GET] /index/type/_search?q=-_exists_:array_field | |
[RESPONSE]: | |
"hits" : | |
{ | |
... | |
"hits" : | |
[ |
This file contains hidden or 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
/// Bind | |
function done(){ | |
console.log('> Done'); | |
console.log( arguments ); | |
} | |
function request( context, url, _done) { _done( context, url, _done ); } |
This file contains hidden or 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
<NotepadPlus> | |
<UserLang name="Fitnesse" ext=".txt" udlVersion="2.1"> | |
<Settings> | |
<Global caseIgnored="no" allowFoldOfComments="yes" foldCompact="no" forcePureLC="0" decimalSeparator="0" /> | |
<Prefix Keywords1="no" Keywords2="yes" Keywords3="yes" Keywords4="no" Keywords5="yes" Keywords6="no" Keywords7="no" Keywords8="no" /> | |
</Settings> | |
<KeywordLists> | |
<Keywords name="Comments">00# 01 02 03!| 04|</Keywords> | |
<Keywords name="Numbers, prefix1"></Keywords> | |
<Keywords name="Numbers, prefix2"></Keywords> |
This file contains hidden or 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
cls | |
function Wait-For | |
{ | |
param( $minutes, $callback ) | |
$untill = (Get-Date).AddMinutes($minutes) | |
Wait-Untill $untill.Hour $untill.Minute $callback | |
} |
This file contains hidden or 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
function Show-BalloonTip | |
{ | |
[CmdletBinding(SupportsShouldProcess = $true)] | |
param | |
( | |
[Parameter(Mandatory=$true)] $Text, | |
[Parameter(Mandatory=$true)] $Title, | |
[ValidateSet('None', 'Info', 'Warning', 'Error')] $Icon = 'Info', | |
$Timeout = 10000 | |
) |
OlderNewer