Skip to content

Instantly share code, notes, and snippets.

@Quacky2200
Quacky2200 / unit-measurement-checks.js
Created January 2, 2020 06:58
Test JavaScript file to test measurements are valid
/**
* This function returns whether the given values are valid measurements.
*
* @param string|string[] inputArray List or string of measures
* @param string|string[] validUnits List or string of valid units
* @param mixed opts Options
* @return boolean Whether measure(s) is valid
*/
function checkValidUnits(inputArray, validUnits, opts) {
@Quacky2200
Quacky2200 / Request.php
Last active July 24, 2020 17:39
Generic request class, mostly for API requests
<?php
/**
* REST test scripts
* @license MIT
*/
class Request {
public $protocol;
public $host;
public $path;
@Quacky2200
Quacky2200 / Program.cs
Last active September 3, 2021 19:45
C# Edition of Base62 integer encode/decode originally from https://gist.github.com/sebastien-p/1170594
using System;
using System.Linq;
using System.Text;
namespace ConsoleApp1
{
class Program
{
public static string Base62EncodeInt(int Original)
{