Skip to content

Instantly share code, notes, and snippets.

View kovetskiy's full-sized avatar
🏊

Egor Kovetskiy kovetskiy

🏊
View GitHub Profile
@AmyrAhmady
AmyrAhmady / sidebars.js
Last active March 7, 2021 11:36
Docusaurus sidebar generator by name of directories and files!
const fs = require("fs");
const path = require('path');
const SIDE_BAR_NAME = 'Sidebar';
const CATEGORY_NAME_CAPITALIZATION = true;
function parseDir(filename) {
const stats = fs.lstatSync(filename);
const info = {}
@junegunn
junegunn / vimawesome.vim
Last active May 10, 2023 15:50
Plugin completion using VimAwesome API
" ----------------------------------------------------------------------------
" vimawesome.com
" ----------------------------------------------------------------------------
function! VimAwesomeComplete() abort
let prefix = matchstr(strpart(getline('.'), 0, col('.') - 1), '[.a-zA-Z0-9_/-]*$')
echohl WarningMsg
echo 'Downloading plugin list from VimAwesome'
echohl None
ruby << EOF
require 'json'
@BlakeGardner
BlakeGardner / compact.js
Last active February 19, 2024 16:55
Compact all collections inside of a MongoDB database
// This script loops though the list of collection names in a MongoDB and runs the compact operation on them
// Simply paste this into the Mongo shell
use testDbName;
db.getCollectionNames().forEach(function (collectionName) {
print('Compacting: ' + collectionName);
db.runCommand({ compact: collectionName });
});