Skip to content

Instantly share code, notes, and snippets.

View kariudo's full-sized avatar
😭
Miserable

Hunter Horsman kariudo

😭
Miserable
  • Square 9 Softworks
  • CT
View GitHub Profile
@kariudo
kariudo / biom_full_scan_task.json
Last active July 11, 2024 16:29
VSCode - Biome - Full project scan task
{
"version": "2.0.0",
"tasks": [
{
"label": "Biome - Full Lint",
"type": "shell",
"command": "yarn",
"args": [
"biome",
"lint",
@kariudo
kariudo / NestedJsonRegexReplacer.cs
Last active June 21, 2024 14:23
C# Nested JSON Regex Replacer
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Text.RegularExpressions;
public class Program
{
public void Main(string[] args)
{
string jsonString = @"{""people"":[{
@kariudo
kariudo / listToMatrix.ts
Created March 2, 2023 15:52
Flat list to matrix
/**
* Convert a flat list into a 2D Array.
*
* @param list Flat list.
* @param elementsPerSubArray Size of inner arrays.
* @returns 2D array of the given size..
*/
private listToMatrix<T>(list: T[], elementsPerSubArray: number): T[][] {
const matrix: T[][] = [];
let index;
We couldn’t find that file to show.
// Converts nested objects and arrays into camelCase, when they were PascalCase to start with
var convert2Camel = function(obj) {
if (Object.prototype.toString.call(obj) === '[object Array]') {
var a = [];
obj.forEach(function(element) {
a.push(convert2Camel(element));
});
return a;
} else {
if (typeof obj == 'object')
@kariudo
kariudo / makeDoubleGreatAgain.vb
Last active May 5, 2017 14:26
A little fiddle to parse a decimal string in the context of multiple cultures.
Imports System
Public Module Module1
Public Sub Main()
Console.WriteLine(Decimal.Parse("-2"))
Console.WriteLine(MakeDoubleGreatAgain("-3.33"))
End Sub
'Parse assorted cutlures for doubles
Public Function MakeDoubleGreatAgain(value As String) As Double
@kariudo
kariudo / todoWarn.js
Created September 23, 2015 13:50
Javascript "Todo" Warning (With Caller) Function
// Used as a UI indicaiton that a feature is not complete. Warns to log.
var TODO = function () {
var callerName = "";
try { //noinspection ExceptionCaughtLocallyJS
throw new Error(); }
catch (e) { callerName = /TODO.+\n\s+at (.+) \(/.exec(e.stack)[1]; }
console.warn('Feature not complete:', callerName);
};

APIDocs


This project was created to allow for easy updating of our publicly documented API methods. It uses its own API to handle the maintenance of documentation so it is affectionatly refered to by me as MetaDocs.

  • API docs are all saved in their own .JSON files in the configured location.
  • Dispaly pages are generated on the fly from templates using .JSON data.

Project Setup

- <CaptureWorkflowLog xmlns="http://schemas.datacontract.org/2004/07/Square9.Objects.XMLImport" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
- <Items>
- <CaptureWorkflowLogEntry>
<BatchId>4</BatchId>
- <History>
- <CaptureWorkflowLogEntryItem>
<DocItemId />
<Message>Importing file into batch: E:\Scans\Med Tech 1\MEDTECH1.pdf</Message>
<MessageCategory>Process</MessageCategory>
<Step>File Import</Step>
@kariudo
kariudo / gist:e95ab97ea509b5ab7878
Last active August 29, 2015 14:01
Select jQuery based on data attribute
$("htmltag[data-field='" + current +"']");
$("[data-api='Foobar'][data-field='name']").text();