Skip to content

Instantly share code, notes, and snippets.

Never stop coding

Cherara Reddah rcherara

Never stop coding
View GitHub Profile
View application.yaml
server config:
map-oauth-scopes: true
View cloudSettings
View Error Handling in React
title author
Error Handling in React 16

As React 16 release is getting closer, we would like to announce a few changes to how React handles JavaScript errors inside components. These changes are included in React 16 beta versions, and will be a part of React 16.

Behavior in React 15 and Earlier

In the past, JavaScript errors inside components used to corrupt React’s internal state and cause it to emit cryptic errors on next renders. These errors were always caused by an earlier error in the application code, but React did not provide a way to handle them gracefully in components, and could not recover from them.

rcherara /
Created Mar 6, 2020 — forked from gaearon/
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal:

View Install Fabric8
# Installing gofabric8
curl -sS | bash
export PATH=$PATH:$HOME/.fabric8/bin
# Starting the cluster
gofabric8 start
gofabric8 start --vm-driver=virtualbox
gofabric8 start --memory=6000 --cpus=2
# Validating your cluster
gofabric8 validate
# Using OpenShift
View PostgreSQL.MD

Installing the PostgreSQL Client

$ brew install libpq


Psql is the interactive terminal for working with Postgres

  $ psql -h localhost -U username databasename
    * -h the host to connect to
    * -U the user to connect with
    * -p the port to connect to (default is 5432)
View GitHub
$ git init
$ git add .
$ git commit -m "First commit"
$ git remote add origin
$ git remote -v
$ git push -u origin master
$ git push --force
$ git push -u origin master
rcherara /
Created Jan 5, 2019
Setup a basic configuration to allow SSH, HTTPS and HTTP incoming
# Install ufw
sudo apt install ufw
# Create and run
chmod +x ./
# Then run the script:
sudo ./
rcherara /
Created Jan 4, 2019
Setup Kubernetes Dashboard on local workstation for Cluster Docker-For-Desktop
# Create a new user using Service Account mechanism of Kubernetes,
kubectl apply -f dashboard-adminuser.yaml
# Bearer Token
# Now we need to find token we can use to log in.
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}')
echo "Now copy the token and paste it into Enter token field on log in screen."
View Using Minikube Locally for Development.MD

Install Minikube with virtual-box VM driver

$ brew update && brew install kubectl && brew cask install docker minikube virtualbox
$ brew cask reinstall minikube
$ minikube delete
$ rm -fr ~/.minikube/