Skip to content

Instantly share code, notes, and snippets.

View zaknafeyn's full-sized avatar
🇺🇦
Support Ukraine

Valentyn Radchuk zaknafeyn

🇺🇦
Support Ukraine
View GitHub Profile
@zaknafeyn
zaknafeyn / 0_reuse_code.js
Last active August 30, 2015 20:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@zaknafeyn
zaknafeyn / Command line parser
Last active August 6, 2019 15:06
Command line parser
Написать приложение-парсер для параметров, введенных из консоли.
Список правил:
CommandParser.exe [/?] [/help] [-help] [-k key value] [-ping] [-print <print a value>]
CommandParser.exe - вызов приложения без параметров показывает то же, что и вызов помощи
/?, /help,-help - вызов помощи
public static class Extensions
{
public static Uri Append(this Uri uri, params string[] paths)
{
return new Uri(paths.Aggregate(uri.AbsoluteUri, (current, path) =>
$"{current.TrimEnd('/')}/{path.TrimStart('/')}"));
}
public static Uri AppendQuery(this Uri uri, params string[] query)
{