Skip to content

Instantly share code, notes, and snippets.

View backslash112's full-sized avatar
🎯
Focusing

Cun Yang backslash112

🎯
Focusing
View GitHub Profile
import java.util.*;
class Main {
public static void main(String[] args) {
System.out.println(modifyStr("").equals(""));
System.out.println(modifyStr("Automotive parts").equals("A6e p3s"));
System.out.println(modifyStr("Automotive par").equals("A6e p1r"));
System.out.println(modifyStr("Automotive pa").equals("A6e p0a"));
System.out.println(modifyStr("Automotive p").equals("A6e p0p"));
System.out.println(modifyStr("**Automotive p").equals("**A6e p0p"));
function decrypt(word) {
// string to char array
let chars = [];
for (let c of word) {
chars.push(c);
}
// step 3
let asciiValues = chars.map(c => c.charCodeAt(0));
console.log(asciiValues);
function countDuplicate(arr) {
let map = new Map();
arr.forEach(num => {
if (map.get(num) > 0) {
// set(key, value)
map.set(num, map.get(num) + 1);
} else {
// set(key, value)
map.set(num, 1);
}
JFS_BASE=/Users/yujunz/JuiceFS
JFS_NAME=rogerz-s3-cn-east-1-qiniu
BUNDLE=TimeMachine.sparsebundle
VOLUME=/Volumes/TimeMachine

# Mount JuiceFS
juicefs mount --cache-dir $JUICEFS_BASE/cache --batch 10 --writeback --metacache --opencache $JFS_NAME $JFS_BASE/$JFS_NAME

# Create sparse bundle
@backslash112
backslash112 / mongodbIndexExporter.js
Last active August 24, 2021 16:02 — forked from ytkang/mongodbIndexExporter.js
Mongodb Index exporter importer
/*
How to export
* mongo is mongoshell command
mongo dbname --quiet mongodbIndexExporter.js > index.js
*/
let collectionNames = db.getCollectionNames();
let index_data = {'collections': []};
for (let i in collectionNames) {