Skip to content

Instantly share code, notes, and snippets.

View Grax32's full-sized avatar
๐Ÿ˜Ž
Secure Developer / Florida

David Walker Grax32

๐Ÿ˜Ž
Secure Developer / Florida
View GitHub Profile
@Grax32
Grax32 / json-closer.js
Last active October 9, 2023 11:34
Auto-Close JSON
/*
Provided that the beginning of the JSON document is present in the fragment, this function will automatically close JSON fragments.
*/
function jsonCloser(src) {
const openChars = [];
let inQuotedString = false;
for (let i = 0; i < src.length; i++) {
const thisChar = src[i];
if (inQuotedString) {
switch (thisChar) {
@dasMulli
dasMulli / Directory.Build.targets
Last active January 18, 2021 16:55
Allow `dotnet test` to be run from solution directory
<Project>
<Target Name="VSTestIfTestProject">
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
</Project>
using System;
using System.Diagnostics;
using System.Numerics;
#if NETCOREAPP2_1_OR_GREATER
using System.Buffers.Binary;
#endif
#nullable enable