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
// Original source: https://github.com/zagyi/adsync4j/blob/master/core/src/main/java/org/adsync4j/impl/UUIDUtils.java | |
/******************************************************************************* | |
* ADSync4J (https://github.com/zagyi/adsync4j) | |
* | |
* Copyright (c) 2013 Balazs Zagyvai | |
* | |
* All rights reserved. This program and the accompanying materials | |
* are made available under the terms of the Eclipse Public License v1.0 | |
* which accompanies this distribution, and is available at |
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
/* | |
*Copyright (C) 2007 Pradyumna Kannan. | |
* | |
*This code is provided 'as-is', without any expressed or implied warranty. | |
*In no event will the authors be held liable for any damages arising from | |
*the use of this code. Permission is granted to anyone to use this | |
*code for any purpose, including commercial applications, and to alter | |
*it and redistribute it freely, subject to the following restrictions: | |
* | |
*1. The origin of this code must not be misrepresented; you must not |
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> | |
/// Simple async XML serializer by Rudy A. Kohn | |
/// MIT License: https://en.wikipedia.org/wiki/MIT_License | |
/// </summary | |
public static class XmlSerializer | |
{ | |
/// <summary> | |
/// Remove xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" | |
/// By adding an empty namespace mapping | |
/// </summary> |
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
public ref struct FastUnsafeStringBuilder { | |
private string s; | |
private int pos; | |
public FastUnsafeStringBuilder(int maxlength) { | |
s = new string('\0', maxlength); | |
pos = 0; | |
} | |
public unsafe void Append(ReadOnlySpan<char> str) { |
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
param( | |
[string] $Major = "8", | |
[string] $Minor = "1", | |
[string] $Update = "0", | |
[string] $Date = "151003", | |
[string] $nugetPath = ".\tools\nuget.exe", | |
[string] $downloadsPath = ".\downloads", | |
[string] $nuspecTemplate = ".\tools\package.nuspec.xml", | |
[string] $apiKey, | |
[string] $nugetFeed = "http://use-your.own/nuget/Sitecore-Libs" |
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
// Will resize a vector based on a specified size. | |
// Can perform a specified function after resizing | |
// For non-copy constructables it will just reassign the vector | |
template<typename T, typename PerformAfter> | |
void align_vector_size(std::vector<T> &vec, const size_t size, const PerformAfter func) { | |
if constexpr (std::is_copy_constructible_v<T>) | |
{ | |
if (vec.size() != size) |
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
#include <string_view> | |
namespace Math { | |
/// Determin if a value is in between (inclusive) to boundries | |
template<int min, int max> | |
constexpr bool in_between(const int value) { | |
return (static_cast<unsigned int>(value) - static_cast<unsigned int>(min) <= static_cast<unsigned int>(max) - static_cast<unsigned int>(min)); | |
} |
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
template<typename T> | |
class Vector : public std::vector<T> { | |
public: | |
Vector() = default; | |
explicit Vector(const T &t) noexcept : std::vector<T>(t, 1) {} | |
void append(const T element, const Vector<T> &vec) noexcept { | |
append(element); | |
std::vector<T>::reserve(vec.size() + 1); | |
for (const auto &v : vec) | |
std::vector<T>::emplace_back(v); |
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
namespace Validation | |
{ | |
public static partial class Validate | |
{ | |
private const string EmailRegex = @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"; | |
private static readonly Regex Regex = new Regex(EmailRegex); | |
public static bool IsEmail(this string @this) |
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
#ifndef RDZ_UTILS_CIOBUF_HPP | |
#define RDZ_UTILS_CIOBUF_HPP | |
#include <iostream> | |
namespace util | |
{ | |
/** | |
* \brief Configure console input buffer size | |
* \tparam buffer The buffer size |
NewerOlder