Skip to content

Instantly share code, notes, and snippets.

View rcherara's full-sized avatar
💭
Never stop coding

Cherara Reddah rcherara

💭
Never stop coding
View GitHub Profile
@rcherara
rcherara / application.yaml
Created March 13, 2021 04:35 — forked from sshepel/application.yaml
SCDF k8s config
server config:
spring:
cloud:
dataflow:
security:
authorization:
provider-role-mappings:
scdf-test:
map-oauth-scopes: true
role-mappings:
{"lastUpload":"2020-05-09T17:19:13.628Z","extensionVersion":"v3.4.3"}
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 March 6, 2020 04:09 — forked from gaearon/minification.md
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:

# 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

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)
@rcherara
rcherara / GitHub
Last active February 21, 2019 18:45
$ 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 January 5, 2019 04:24
Setup a basic configuration to allow SSH, HTTPS and HTTP incoming
#!/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 January 4, 2019 03:48
Setup Kubernetes Dashboard on local workstation for Cluster Docker-For-Desktop
#!/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."

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/