Skip to content

Instantly share code, notes, and snippets.

View abhijit-hota's full-sized avatar
🦕

Abhijit Hota abhijit-hota

🦕
View GitHub Profile

FZF Scripts

  • ksend: send files to other devices using kdeconnect
  • fz-open: navigate directory structure to find and open files
  • editdot: open dotfiles tracked by yadm in $EDITOR
  • dotlog: browse git log of dotfiles tracked by yadm, preview diff and copy commit hash

Moved to repo: /quenhus/uBlock-Origin-dev-filter

In order to keep filters up to date, please use this repo.

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@2KAbhishek
2KAbhishek / Shell_Keybindings.md
Last active June 18, 2024 10:36
Keyboard shortcuts for bash/zsh

Shell Keybindings

Navigation 🚀

Alt + f/b - Move cursor to previous/next word

Ctrl + a/e - Move cursor to beginning/end of command

Ctrl + xx - Toggle between the start of line and current cursor position

@rjz
rjz / crypto-aes-256-gcm-demo.js
Last active March 11, 2024 20:11
example using node.js crypto API with aes-256-gcm
const buffer = require('buffer');
const crypto = require('crypto');
// Demo implementation of using `aes-256-gcm` with node.js's `crypto` lib.
const aes256gcm = (key) => {
const ALGO = 'aes-256-gcm';
// encrypt returns base64-encoded ciphertext
const encrypt = (str) => {
// The `iv` for a given key must be globally unique to prevent
@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active June 22, 2024 02:47
Hyperlinks in Terminal Emulators
@chrisveness
chrisveness / crypto-aes-gcm.js
Last active May 30, 2024 17:09
Uses the SubtleCrypto interface of the Web Cryptography API to encrypt and decrypt text using AES-GCM (AES Galois counter mode).
/**
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt().
* (c) Chris Veness MIT Licence
*
* @param {String} plaintext - Plaintext to be encrypted.
* @param {String} password - Password to use to encrypt plaintext.
* @returns {String} Encrypted ciphertext.
*
* @example
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw');
@vlucas
vlucas / encryption.js
Last active June 7, 2024 04:27
Stronger Encryption and Decryption in Node.js
'use strict';
const crypto = require('crypto');
const ENCRYPTION_KEY = process.env.ENCRYPTION_KEY; // Must be 256 bits (32 characters)
const IV_LENGTH = 16; // For AES, this is always 16
function encrypt(text) {
let iv = crypto.randomBytes(IV_LENGTH);
let cipher = crypto.createCipheriv('aes-256-cbc', Buffer.from(ENCRYPTION_KEY), iv);
@olih
olih / jq-cheetsheet.md
Last active June 22, 2024 18:30
jq Cheet Sheet

Processing JSON using jq

jq is useful to slice, filter, map and transform structured json data.

Installing jq

On Mac OS

brew install jq