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
class Person { | |
name!: string; | |
age!: number; | |
sex!: string; | |
public toString = () : string => JSON.stringify(this); | |
} | |
const people: Person[] = [ | |
{ age: 25, sex: 'f', name: 'Sue' }, | |
{ age: 30, sex: 'f', name: 'Angela' }, |
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
Public Sub tojson() | |
Dim fso As Object | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
jsonFilename = fso.GetBaseName(ActiveWorkbook.Name) & ".json" | |
fullFilePath = Application.ActiveWorkbook.Path & "\" & jsonFilename | |
Dim fileStream As Object | |
Set fileStream = CreateObject("ADODB.Stream") | |
fileStream.Type = 2 'Specify stream type - we want To save text/string data. | |
fileStream.Charset = "utf-8" 'Specify charset For the source text data. |
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
#pragma once | |
#include <cstdint> | |
#include <new> | |
#include <limits> | |
#include <intrin.h> | |
namespace cova::mem |
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
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; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Reflection; | |
using System.Reflection.Emit; | |
namespace NickStrupat | |
{ | |
public static class ModuleBuilderExtensions | |
{ |
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
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 |
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
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 = ' ') | |
{ |
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
$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 |
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
docker run -it -e DOCKER_HOST_USER_DOMAIN_NAME=$([System.Environment]::UserDomainName) -e DOCKER_HOST_USER_NAME=$([System.Environment]::UserName) mcr.microsoft.com/powershell |
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
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) { |