Skip to content

Instantly share code, notes, and snippets.

View BananaAcid's full-sized avatar

Nabil Redmann BananaAcid

View GitHub Profile

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by
@BananaAcid
BananaAcid / crypto-stream.js
Created April 24, 2022 22:55 — forked from chris-rock/crypto-stream.js
Encrypt and decrypt streams
// Part of https://github.com/chris-rock/node-crypto-examples
// Nodejs encryption of buffers
var crypto = require('crypto'),
algorithm = 'aes-256-ctr',
password = 'd6F3Efeq';
var fs = require('fs');
var zlib = require('zlib');
@BananaAcid
BananaAcid / autoshrink.js
Last active October 20, 2016 05:40 — forked from andrewbranch/autoshrink.js
Responds to window resize events. Max font size taken from initial font size (specify with CSS). [no modifications, just forked to extend the example.]
(function($) {
function getTextWidth($element) {
var tester = $("<div/>").text($element.text())
.css({ "position": "absolute", "float": "left", "white-space": "nowrap", "visibility": "hidden", "font": $element.css("font"), "text-transform": $element.css("text-transform"), "letter-spacing": $element.css("letter-spacing") })
.appendTo($element.parent()),
width = tester.innerWidth();
tester.remove();
return width;
}