Skip to content

Instantly share code, notes, and snippets.

View ekas's full-sized avatar
😇
Loving it.

Ekas Preet Singh ekas

😇
Loving it.
  • Lufthansa Technik
  • Hamburg, Germany
  • 05:32 (UTC +02:00)
  • X @ekaspreet93
View GitHub Profile

Guide

CMD

Postgres

  • docker pull bitnami/postgresql
  • docker run --name postgresql-server -e POSTGRESQL_PASSWORD=pass bitnami/postgresql:latest

Docker Specific terminal

@ekas
ekas / clean_code.md
Created April 29, 2021 11:49 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

The Task

Since we want to keep this challenge rather less time consuming, we want you to create a small React app and display popular repositories of the week from Github. The user should have an opportunity to filter the repositories by the programming language of choice.

That would be nice to see some information about the repositories such as repository name, descriptions, etc.

Additional Info

  • Please have a look at Github documentation to find out the desired endpoint.
  • Feel free to experiment anything concerning the styles.
@ekas
ekas / ImageLoad.js
Created August 26, 2020 17:32 — forked from nirajrajgor/ImageLoad.js
Progressive load image component in react with hooks
import React, { useState, useEffect } from 'react';
const ImageLoad = React.memo(({ src, placeholder, alt = "" }) => {
const [loading, setLoading] = useState(true);
const [currentSrc, updateSrc] = useState(placeholder);
useEffect(() => {
// start loading original image
const imageToLoad = new Image();
imageToLoad.src = src;
@ekas
ekas / node_nginx_ssl.md
Last active February 14, 2021 15:58 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

docker image dockerdev-enp.bin.cloud.barco.com/tfnnxt/system-manager-open-api:0.0.1-setup-NET0101-589-85e5dd9bb4-jenkins-10
docker image dockerdev-enp.bin.cloud.barco.com/tfnnxt/wall-space:0.0.0-ui-screen-work-flow-b3533838a9-jenkins-5
// Creating subarrays for input array given based on variable size k.
// Example: Input: [8, 2, 4, 20] & k=2 it should output to[[8, 2], [2, 4], [4, 20]]

const subArr = (arr, k) => {
  return arr.map((a, i) => {
    return arr.slice(i, k + i).length === k ? arr.slice(i, k + i) : '';
  }).filter((a) => a.length);
}
@ekas
ekas / learn_typescript.md
Last active December 8, 2022 02:14
Let's Gear Up for TypeScript

🚀 🚀 Let's Gear Up for TypeScript 🎉 🎉

TypeScript is a typed superset of JavaScript that compiles to plain JavaScript. Any browser. Any host. Any OS. Open source.

Basic Types

  • Boolean
let isDone: boolean = false;
@ekas
ekas / ngIndia_Slides.md
Last active March 8, 2020 07:04
ngIndia 2020 - Speaker Decks & Notes

React Questions

1. Does create-react-app have any default css preproccesor included ? If No, which package provides the capability to have abc.scss files in the project.

  • A: sass-loader
  • B: node-scss
  • C: node-sass
  • D: Yes, it already has a Preprocessor