Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Never stop coding

Cherara Reddah rcherara

💭
Never stop coding
View GitHub Profile
View application.yaml
server config:
spring:
cloud:
dataflow:
security:
authorization:
provider-role-mappings:
scdf-test:
map-oauth-scopes: true
role-mappings:
View cloudSettings
{"lastUpload":"2020-05-09T17:19:13.628Z","extensionVersion":"v3.4.3"}
View Error Handling in React 16.md
title author
Error Handling in React 16
gaearon

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
rcherara / minification.md
Created Mar 6, 2020 — forked from gaearon/minification.md
How to Set Up Minification
View minification.md

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 https://get.fabric8.io/download.txt | 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

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 https://github.com/Reddah-Cherara/rcherara-api-book-go.git
$ git remote -v
$ git push -u origin master
$ git push --force https://github.com/Reddah-Cherara/rcherara-api-book-go.git
$ git push -u origin master
@rcherara
rcherara / close_incoming_connections.sh
Created Jan 5, 2019
Setup a basic configuration to allow SSH, HTTPS and HTTP incoming
View close_incoming_connections.sh
#!/bin/sh
# Install ufw
sudo apt install ufw
# Create setup_firewall.sh and run
chmod +x ./setup_firewall.sh
# Then run the script:
sudo ./setup_firewall.sh.
@rcherara
rcherara / create-service-account.sh
Created Jan 4, 2019
Setup Kubernetes Dashboard on local workstation for Cluster Docker-For-Desktop
View create-service-account.sh
#!/bin/bash
# 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/