Skip to content

Instantly share code, notes, and snippets.

Avatar

Tejus tejzpr

  • Cisco
  • https://discord.gg/EmFDXkd
View GitHub Profile
View base_62_converter.js
// JavaScript (ES6) port of the code at https://gist.github.com/bhelx/778542
// Also handles leading 0's in strings
const BASE = 62;
const UPPERCASE_OFFSET = 55;
const LOWERCASE_OFFSET = 61;
const DIGIT_OFFSET = 48;
class Base62{
constructor() {
View CopyMongoCollection.js
//Fastest way to copy a Collection in MongoDB
db.getCollection('OriginalCollection').aggregate([ { $out: "ClonedCollection" } ]);