Skip to content

Instantly share code, notes, and snippets.

View akash07k's full-sized avatar
😊
New dimension of the code 🥏

Akash Kakkar akash07k

😊
New dimension of the code 🥏
View GitHub Profile
@akash07k
akash07k / KeyEventSimulator.js
Created September 10, 2022 16:42 — forked from GlauberF/KeyEventSimulator.js
A function for simulating key event in JavaScript. You just have to choose what key and keyboard event you want to simulate.
/**
* Simulate a key event.
* @param {Number} keyCode The keyCode of the key to simulate
* @param {String} type (optional) The type of event : down, up or press. The default is down
* @param {Object} modifiers (optional) An object which contains modifiers keys { ctrlKey: true, altKey: false, ...}
*/
function simulateKey (keyCode, type, modifiers) {
var evtName = (typeof(type) === "string") ? "key" + type : "keydown";
var modifier = (typeof(modifiers) === "object") ? modifier : {};
@akash07k
akash07k / bitwarden-backup.sh
Created June 13, 2022 15:00 — forked from athphane/bitwarden-backup.sh
Bash script to zip up Vaultwarden data directory and upload to Cloud storage.
#!/bin/bash
#edit these to your config
BWDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
DATETIME="$(date +'%Y-%m-%d_%H-%M-%S')"
FOLDERPATH="$(date +'%Y-%m-%d')"
GZFILE=bitwarden-${DATETIME}.tar.gz
#change working dir to /tmp
cd /tmp/