Skip to content

Instantly share code, notes, and snippets.

@XWolfOverride
XWolfOverride / MongoBackup.js
Created February 21, 2025 12:49
MongoDB backup and restore to local fs, designed to work on mongosh or mongodb compass shell
var bk=new (function(){
//use <database> first
const fs = require("fs");
const os = require("os")
const home=`${os.homedir()}/mongo-backup`;
function backupTo(path){
if (!path)
throw new Error("use bk.backup('directory')");
if (!fs.existsSync(path))
fs.mkdirSync(path);
@XWolfOverride
XWolfOverride / ezDB.js
Last active February 21, 2025 12:02
ezDB a simple way to use IndexedDB on pages for settings without loosing the head.
function ezDB(name) {
let request = indexedDB.open(name, 1);
let db;
let qu = [];
const table = "MyObjectStore";
request.onupgradeneeded = function (event) {
let db = event.target.result;
let objectStore = db.createObjectStore(table, { keyPath: "id" });
};
@XWolfOverride
XWolfOverride / mz.html
Last active January 14, 2022 12:41
Maze generator and resolvers in JS / HTML
<html>
<head>
<title>Mz</title>
<style>
table {
border-spacing: 0;
border-collapse: spaced;
}
@XWolfOverride
XWolfOverride / shBrushAbap.js
Created February 28, 2016 11:58 — forked from christianjianelli/shBrushAbap.js
SyntaxHighlighter brush for ABAP code
/**
* SyntaxHighlighter
* http://alexgorbatchev.com/SyntaxHighlighter
*
* SyntaxHighlighter is donationware. If you are using it, please donate.
* http://alexgorbatchev.com/SyntaxHighlighter/donate.html
*
* @version
* 3.0.83 (July 02 2010)
*