Skip to content

Instantly share code, notes, and snippets.

@inadarei
inadarei / base64.js
Created January 6, 2013 04:11
base64 encode/decode in Node.js
var url = "http://cdn1.giltcdn.com/images/share/uploads/0000/0001/7250/172502872/420x560.jpg";
var encoded = new Buffer(url).toString('base64');
var decoded = new Buffer(encoded, 'base64').toString('ascii')
console.log(encoded);
console.log(decoded);
@victorboissiere
victorboissiere / vs.zsh
Created April 3, 2018 19:21
[MEDIUM] vs with autocomplete
function vs()
{
RESULTS=`find . -type f -not -path '*/\.*' -not -path '*/vendor/*' -not -path '*/packages/*' -ipath "*$1*"`
red() { echo -e "\033[00;31m$1\033[0m"; }
NB_FILES=$(echo $RESULTS | wc -w)
if [ $NB_FILES -eq "1" ]; then
$EDITOR $(echo "$RESULTS" | head -n1 | cut -d " " -f1)
elif [ $NB_FILES -eq "0" ]; then
>&2 red "No matching file"
else