Skip to content

Instantly share code, notes, and snippets.

Emmanuel N Kyeyune emmanuelnk

View GitHub Profile
@emmanuelnk
emmanuelnk / terraform_install_64bit_linux.bash
Created Apr 10, 2019
Install Terraform on 64 bit Linux
View terraform_install_64bit_linux.bash
# 0.XX.XX is the terraform version you need
wget https://releases.hashicorp.com/terraform/0.XX.XX/terraform_0.XX.XX_linux_amd64.zip -P ~/Downloads/terraform/
cd ~/Downloads/terraform && unzip terraform_0.11.8_linux_amd64.zip && cd terraform
sudo mv terraform /usr/local/bin/
nano ~/.bashrc
export PATH="$PATH:/usr/local/bin/terraform"
source ~/.bashrc
# then from anywhere
@emmanuelnk
emmanuelnk / cleanEmpty.js
Created May 13, 2020
Clean js object by recursive removal of undefined, null, NaN and empty strings
View cleanEmpty.js
// A SO answer to https://stackoverflow.com/questions/286141/remove-blank-attributes-from-an-object-in-javascript
// based off the recursive cleanEmpty function by @chickens.
// This one can also handle Date objects correctly
// and has a defaults list for values you want stripped.
const cleanEmpty = function(obj, defaults = [undefined, null, NaN, '']) {
if (defaults.includes(obj)) return
if (Array.isArray(obj))
return obj
@emmanuelnk
emmanuelnk / pygrib_eccodes_python3.6_install.md
Last active Apr 20, 2020
How to install PyGrib with ECCodes (Python 3.6.5, Ubuntu 18, 16, RHEL)
View pygrib_eccodes_python3.6_install.md

How to install PyGrib with ECCodes (Python 3.6.5, Ubuntu 19, 18, 16, RHEL, Lambda, Linux AMI, Docker)

[ last_updated: 07-JAN-2020 ]

Recently I've had to work with Meterological data of the GRIB format. Needless to say, if you're reading this, you probably know how hard it is to get a library that can read them and even harder, setting up those libraries. Pygrib for python is by far the best library for reading grib files but the installation can leave you dizzy

In this tutorial I use Ubuntu 18 and python 3.6.5 virtualenv. Note: You don't have to use virtualenv Python. You can just as well use your system Python 3 however I personally find virtualenv a clean way to deal with these kind of complicated setups (prevents me mucking up my system's Python). This setup should also work with lower and higher Ubuntu versions (as someone below mentioned) and other Linux distros (like RHEL - AWS Linux AMI etc). The key to this installation is to build eccodes correctly (for your machine architecture) and succe

@emmanuelnk
emmanuelnk / README.md
Created Apr 17, 2020 — forked from boneskull/README.md
example of how to debug mocha v4 if hanging
View README.md

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 / master-javascript-interview.md
Created Apr 8, 2020 — forked from Geoff-Ford/master-javascript-interview.md
Eric Elliott's Master the JavaScript Interview Series
View master-javascript-interview.md
@emmanuelnk
emmanuelnk / composing-software.md
Created Apr 8, 2020 — forked from Geoff-Ford/composing-software.md
Eric Elliott's Composing Software Series
View composing-software.md

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 / script.bash
Created Apr 24, 2019
Installing vscode transparency/blur ubuntu 18.04
View script.bash
sudo apt install i3
# check architecture, get correct compton file
dpkg --print-architecture
# download matching compton .deb file from https://launchpad.net/ubuntu/bionic/+package/compton
# install compton
sudo apt-get install ~/Downloads/compton_0.1_beta2+20150922-1_amd64.deb
# get visual studio code source code repo
@emmanuelnk
emmanuelnk / npm-commands.md
Created Feb 14, 2020 — forked from ankurk91/npm-commands.md
Useful npm commands and tricks
View npm-commands.md

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 / .bashrc
Last active Jan 17, 2020
Installing virtual node environments with nodeenv.
View .bashrc
# 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 / start_dynamodb_local_docker.bash
Last active Jan 15, 2020
Start Dyanmodb Local docker with sharedDb param to enable dyanmodb-admin and localhost:8000/shell to view tables
View start_dynamodb_local_docker.bash
docker run -p 8000:8000 amazon/dynamodb-local -jar DynamoDBLocal.jar -sharedDb
You can’t perform that action at this time.