Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@emmanuelnk
emmanuelnk / .gitconfig
Last active January 6, 2020 07:10
Git Recent: Add git alias to display recently accessed branches in descending order (and with color!)
[alias]
recent = "!r(){ git for-each-ref --sort=-committerdate refs/heads --format='%(HEAD)%(color:yellow)%(refname:short)|%(color:bold green)%(committerdate:relative)|%(color:blue)%(subject)|%(color:magenta)%(authorname)%(color:reset)' --color=always|column -ts'|'; }; r"
@emmanuelnk
emmanuelnk / oneliner.bash
Created January 10, 2020 08:08
Convert all filenames in current directory to lowercase (Bash)
for i in $( ls | grep [A-Z] ); do mv -i $i `echo $i | tr 'A-Z' 'a-z'`; done
@emmanuelnk
emmanuelnk / start_dynamodb_local_docker.bash
Last active January 15, 2020 01:59
Start Dyanmodb Local docker with sharedDb param to enable dyanmodb-admin and localhost:8000/shell to view tables
docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb
@emmanuelnk
emmanuelnk / .bashrc
Last active January 17, 2020 05:32
Installing virtual node environments with nodeenv.
# start nodeenv virtual env if it exists
# for whenever you open integrated terminal in vscode
if [ -d ".nenv" ]; then
. ".nenv/bin/activate"
fi
@emmanuelnk
emmanuelnk / npm-commands.md
Created February 14, 2020 03:33 — forked from ankurk91/npm-commands.md
Useful npm commands and tricks

npm v3.10 - ◾

If you are learning npm then i would suggest to go for yarn, dont waste your time in learning npm

⚠️ This gist is outdated, but most of the commands are still relevant.

Update npm itself

npm install -g npm
# Downgrade to a specific version
@emmanuelnk
emmanuelnk / composing-software.md
Created April 8, 2020 09:11 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@emmanuelnk
emmanuelnk / master-javascript-interview.md
Created April 8, 2020 09:11 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
@emmanuelnk
emmanuelnk / README.md
Created April 17, 2020 07:36 — forked from boneskull/README.md
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
@emmanuelnk
emmanuelnk / ui_select_widget.sh
Created August 12, 2020 16:00
Pure BASH interactive CLI/TUI menu (single and multi-select/checkboxes)
#!/bin/bash
# CREDITS
# Author: Markus Geiger <mg@evolution515.net>
# Permission to copy and modify is granted under the Creative Commons Attribution 4.0 license
# Updated by Bluerayne: https://gist.github.com/blurayne/f63c5a8521c0eeab8e9afd8baa45c65e
# INSPIRED BY
# - https://serverfault.com/questions/144939/multi-select-menu-in-bash-script
# https://www.bughunter2k.de/blog/cursor-controlled-selectmenu-in-bash
@emmanuelnk
emmanuelnk / docker_docker_compose_non_root_install.md
Last active October 21, 2020 07:23
Install and use docker and docker-compose on Linux, Ubuntu without SUDO (NON-ROOT)

Are you tired of having to run docker as root? Well look no further, the solution is here. The instructions below were tested on Ubuntu 20.04

First, if you haven't already, install and enable docker:

    sudo apt update && sudo apt install docker.io --yes 
    sudo systemctl enable --now docker

Download latest docker compose (or replace latest in url with desired version number):