Skip to content

Instantly share code, notes, and snippets.

#pragma once
#if defined(_WIN32)
# include <Windows.h>
#elif defined(__APPLE__) || defined(LINUX)
# include <sys/mman.h>
#endif
#include <optional>
#include "result.hpp"
#pragma once
#include <cstdint>
#include <new>
#include <limits>
#include <intrin.h>
namespace cova::mem
using System;
using System.Collections.Generic;
class ArrayEqualityComparer<TElement> : IEqualityComparer<TElement[]>
{
public static readonly ArrayEqualityComparer<TElement> Default =
new ArrayEqualityComparer<TElement>(EqualityComparer<TElement>.Default);
private readonly IEqualityComparer<TElement> elementEqualityComparer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
namespace NickStrupat
{
public static class ModuleBuilderExtensions
{
powershell -Command "Invoke-WebRequest https://repo.anaconda.com/archive/Anaconda3-5.3.0-Windows-x86_64.exe"
start /wait "" Anaconda3-5.3.0-Windows-x86_64.exe /InstallationType=JustMe /RegisterPython=0 /S /D=%UserProfile%\Anaconda3
cmd "/K" %UserProfile%\Anaconda3\Scripts\activate.bat %UserProfile%\Anaconda3
conda update -y conda
conda update -y anaconda
conda update -y python
conda update -y --all
conda create --name tf-gpu
@NickStrupat
NickStrupat / SplitIntoAll.cs
Last active October 2, 2018 18:09
Split sentence into all possible combinations of sub-sentences
using System;
using System.Collections.Generic;
using System.Linq;
namespace WhaHappen
{
public static class StringExtensions
{
public static IEnumerable<String> SplitIntoAll(this String s, Char delimiter = ' ')
{
@NickStrupat
NickStrupat / docker-run.ps1
Created July 5, 2018 06:05
Pass domain and user names into docker container
docker run -it -e DOCKER_HOST_USER_DOMAIN_NAME=$([System.Environment]::UserDomainName) -e DOCKER_HOST_USER_NAME=$([System.Environment]::UserName) mcr.microsoft.com/powershell
$isDesktop = $PSEdition -eq "Desktop"
$isCore = $PSEdition -eq "Core"
if ($isDesktop -or ($isCore -and $IsWindows)) {
Write-Output Windows
}
elseif ($isCore -and $IsLinux) {
Write-Output Linux
}
elseif ($isCore -and $IsMacOS) {
Write-Output macOS
Enum OSType {
Windows
Linux
}
function Ensure-Docker-Container-Engine-Mode([OSType] $osType) {
[OSType] $currentOSType = docker info --format "{{.OSType}}"
Write-Output "Current engine: $($currentOSType)"
Write-Output "Requested engine: $($osType)"
if ($currentOSType -eq $osType) {
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "http://json-schema.org/draft-07/schema#",
"title": "Rosetta Configuration",
"type": "object",
"properties": {
"Options": {
"type": "object",
"additionalProperties": {}
},