Skip to content

Instantly share code, notes, and snippets.

View gintsgints's full-sized avatar
🏠
Working from home

Gints gintsgints

🏠
Working from home
  • Balcia SIA
  • Riga, Latvia.
View GitHub Profile
export function useScrollHandler() {
const offsets: Array<Number> = [];
let touchStartY = 0;
let activeSection = 0;
let inMove = false;
const mountHandler = () => {
calculateSectionOffsets();
window.addEventListener('keydown', handleKeyDown);
window.addEventListener('DOMMouseScroll', handleMouseWheelDOM); // Mozilla Firefox

How to enable at VS Code studio

  • Install plugin Standard
  • For vettur choose formatter VS Code Typescript

Deployment -> Service -> Ingress

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: attachment
  name: server

How to restore kubernetes after certificate expire

Based on - https://stackoverflow.com/questions/56320930/renew-kubernetes-pki-after-expired/56334732#56334732

$ cd /etc/kubernetes/pki/
$ mv {apiserver.crt,apiserver-etcd-client.key,apiserver-kubelet-client.crt,front-proxy-ca.crt,front-proxy-client.crt,front-proxy-client.key,front-proxy-ca.key,apiserver-kubelet-client.key,apiserver.key,apiserver-etcd-client.crt} ~/
$ kubeadm init phase certs all --apiserver-advertise-address <IP>
$ cd /etc/kubernetes/
$ mv {admin.conf,controller-manager.conf,mv kubelet.conf,scheduler.conf} ~/

docker-compose.yml

version: '3'
services:
  server:
    image: postgrest/postgrest
    ports:
      - "3000:3000"
    links:
 - db:db