Skip to content

Instantly share code, notes, and snippets.

View HR's full-sized avatar

Habib Rehman HR

View GitHub Profile
@HR
HR / closeLink.scpt
Last active April 24, 2016 12:52
Close tabs starting with a URL in Chrome Applescript
@HR
HR / encrypt.js
Last active August 23, 2018 01:19
Node.js AES file encryption with authentication promise
'use strict'
/**
* AES file encryption with authentication (using Promises)
* (C) Habib Rehman 2016
******************************/
const encrypt = function (origpath, destpath, key) {
// decrypts any arbitrary data passed with the pass
return new Promise(function (resolve, reject) {
// readstream to read the (unencrypted) file