Skip to content

Instantly share code, notes, and snippets.

View KiranMantha's full-sized avatar
🎯
Focusing on PlumeJS

Kiran Mantha KiranMantha

🎯
Focusing on PlumeJS
View GitHub Profile
@KiranMantha
KiranMantha / jest-with-angular.md
Last active March 5, 2024 09:51
integration of jest in angular

Setting Jest in angular project

  1. run npm i -D jest @types/jest jest-preset-angular
  2. run npm uninstall -D jasmine @types/jasmine karma karma-jasmine karma-jasmine-html-reporter karma-phantomjs-launcher karma-sonarqube-unit-reporter
  3. Delete src/test.ts, karma.conf.js
  4. Create jest.setup.ts, jest.config.js at root folder level.
  5. Content for jest.setup.ts:
import 'jest-preset-angular';

Object.defineProperty(window, 'CSS', {value: null});
@KiranMantha
KiranMantha / sonar-with-jest.md
Last active March 5, 2024 09:51
Setting sonar with jest

Setting sonar with jest

  1. install jdk12 or above
  2. add JAVA_HOME variable path to environment variables with value C:\Program Files\Java\jdk-<version-number>\
  3. download sonarqube community edition from https://www.sonarqube.org/downloads/
  4. extract zip folder and run the StartSonar.bat from sonarqube\bin\windows-x86–64
  5. navigate to http://localhost:9000 to see sonar dashboard.
  6. navigate to angular project and create sonar-project.properties file
  7. add below content to analyze sonar results in local machine:
sonar.projectKey=<your-project-key>
/** My comments -taw -- Source location of this script: https://gist.github.com/taw00/1c014549dd649c597518e6eb4f1e3969
* To use in Google Sheets:
* - Open or create Google Spreadsheet
* - Click on Tools -> Script Editor
* - Click Create script for Spreadsheet
* - Delete the placeholder content and paste the code from this script
* - Click the save button and give the project a name
* - Back in the spreadsheet, in a cell, you can type “=ImportJSON()” and begin filling out it’s parameters.
* Original developer:
* - http://blog.fastfedora.com/projects/import-json
@KiranMantha
KiranMantha / jest-with-esm.md
Last active March 5, 2024 09:50 — forked from rstacruz/README.md
Setting up Jest with ESM

Setting up Jest with ESM

Here are some different ways on how to set up Jest to support ESM. This applies for Jest v25, Node v13, and Babel v7.

Method A: Native Node.js support

Node v14 and Jest v26 support ESM natively with the --experimental-vm-modules flag.

Install cross-env:

@KiranMantha
KiranMantha / setup-keycloak.md
Last active March 16, 2024 17:22
Setup keycloak

Keycloak setup

  • install docker
  • in order to run keycloak in a docker container, run the below command:
docker run -p 8080:8080 -e KEYCLOAK_ADMIN=admin -e KEYCLOAK_ADMIN_PASSWORD=admin quay.io/keycloak/keycloak:latest start-dev

If you are using podman then just replace docker with podman in above bash command

@KiranMantha
KiranMantha / setup-kafka-locally.md
Created March 7, 2024 06:53
setup kafka locally

Install kafka

Without docker

  • download kafka tar file from official site
  • extract the downloaded tar file and cd to that location
  • run zookeeper through bin/zookeeper-server-start.sh config/zookeeper.properties
  • once zookeeper is up and running, in another terminal execute bin/kafka-server-start.sh config/server.properties to start kafka
  • once kafka is up and running, it need to have one topic before consuming it to emit and read events. for this in a new terminal execute bin/kafka-topics.sh --create --topic quickstart-events --bootstrap-server localhost:9092
@KiranMantha
KiranMantha / accessibility-tools.md
Last active April 30, 2024 23:54
list of accessibility tools

Opensource accessibility audit tools you must know

Accessibility is the ability to make websites usable by everyone. When a website is not accessible, we are creating barriers and making their impairment a disability. We need to build websites and include accessibility testing in our STLC to cater to people with disabilities for both better business and usability. Accessibility testing involves checking whether a website abides by WCAG guidelines and accessibility legislation and yields better SEO.

Accessibility (a11y) audit is a combination of automated and manual testing done using assistive tools. An audit tool helps the recipient to understand the issues, provides steps to reproduce the issue, recommendations for guidance and output the compliance goal.

Let's explore some of the widely-used accessibility audit tools

Lighthouse

Lighthouse is an open-source, automated tool that can audit web pages regarding performance or accessibility issues. 

@KiranMantha
KiranMantha / kubernetes-notebook.md
Last active October 24, 2024 11:13
Kubernetes notebook

Original Article: https://kodekloud.com/blog/kubernetes-objects/

What Are Objects Used for in Kubernetes? 11 Types Explained

Kubernetes is a container orchestration tool, used to deploy & manage containerized applications in an automated way.

One of the key concepts in Kubernetes is the "desired state," which refers to the configurations of the applications that you want to deploy and run. Essentially, it's the way you want your applications to be set up and how you want them to behave in a Kubernetes environment. This includes things like how many instances of applications should be running, how those instances should be networked together, what resources they should have access to, and so on.

So, how do you define the desired state? By using objects.

What Are Kubernetes Objects?

@KiranMantha
KiranMantha / kafka.md
Last active May 10, 2024 06:32 — forked from kim-hyunjin/kafka.md
How to operate Kafka, mostly using Docker

Kafka Distributed Streaming Platform

Publish and Subscribe / Process / Store

Start Kafka

  • Kafka uses ZooKeeper as a distributed backend.

Start Zookeeper