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 : {};

Keybase proof

I hereby claim:

  • I am akash07k on github.
  • I am akashk07 (https://keybase.io/akashk07) on keybase.
  • I have a public key whose fingerprint is 97F4 91C9 A464 F638 E690 D61E 41B1 AAFB 7E8C 1B93

To claim this, I am signing this object:

@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/
@akash07k
akash07k / index.html
Last active July 30, 2021 15:31
Electron ContextBridge Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta
http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self'"
/>
<title>ContextBridge Demo</title>