Skip to content

Instantly share code, notes, and snippets.

function sort(array) {
for (let j = 0; j < array.length; j++) {
var smallest = j;
for (let i = j + 1; i < array.length; i++) {
if (array[smallest] <= array[i]) {
smallest = i;
}
}
array.unshift(array.splice(smallest, 1)[0]);
}
@r8928
r8928 / opt-input.js
Created December 22, 2022 08:08
Webcomponent to take OTP code
(() => {
class OtpInput extends HTMLElement {
static formAssociated = true;
inputs = [];
element;
otp_length = 6;
value_ = "";
constructor() {
super();
@r8928
r8928 / httpd.conf
Created December 1, 2022 14:57
httpd.conf for twsaa multi-domain
# Apache Hause .conf file for TLS/1.3 supported versions
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
git clone https://github.com/r8928/phpexcel-reference-errors.git phpexcel
cp -rf phpexcel vendor/phpoffice
rm -rf phpexcel
@r8928
r8928 / dvrscan.bat
Created September 6, 2021 16:19
dvr-scan motion detect bat file
set vn=A13_20210814231245
ffmpeg\bin\ffmpeg.exe -i "D:\Dropbox\LP59th\%vn%.mp4" -filter:v fps=1 -an "C:\v\%vn%.mjpeg"
dvr-scan -i "C:\v\%vn%.mjpeg" -df 4 -l 1
@r8928
r8928 / vhost.sh
Last active February 6, 2022 01:21
apache virtual host creation script
#!/bin/bash
if [ $# -eq 0 ]
then
echo "No arguments supplied"
exit;
fi
if [ -z "$2" ]
then