Skip to content

Instantly share code, notes, and snippets.

View akkikumar72's full-sized avatar
Focusing

Akash Kumar Pathak akkikumar72

Focusing
View GitHub Profile

Animation

I just wanted to rebuild the phone animation from "Brian Phillips". Thanks for this nice animation! :)

A Pen by Norman Dubois on CodePen.

License.

@akkikumar72
akkikumar72 / .md
Created February 13, 2019 15:26
Folder structure for testserver frontend

Folder structure for testserver frontend

For JavaScript Every component(functionality) should have its own folder inside src/ comprises of componentName.test.js & componentName.scss file

Note: If that component doesn’t have any custom styles then we can get rid of .scss file

Every route in url should have a corresponding component inside containers folder e.g if url is login then /containerloginLoginPage.js/

classNames inside of components should be camelCase.

@akkikumar72
akkikumar72 / folderStructure.md
Last active February 13, 2019 15:30
Folder structure for testserver frontend

Folder structure for testserver frontend

For JavaScript

  • Every component(functionality) should have its own folder inside src/ comprises of /componentName.test.js & componentName.scss/ file
  • Every route in url should have a corresponding component inside containers folder e.g if url is /login then /containerloginLoginPage.js
  • classNames inside of components should be camelCase.

Note: If that component doesn’t have any custom styles then we can get rid of ./scss/ file

@akkikumar72
akkikumar72 / scanForm.js
Created November 20, 2019 15:04
Using useReducer
import React, { useState, useReducer } from 'react';
import { useSelector, useDispatch } from 'react-redux';
import Select from 'react-select';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faSpinner } from '@fortawesome/free-solid-svg-icons';
import { scanRepo } from '../../actions/scanActions';
import { Redirect } from 'react-router-dom';
import './scan.scss';
import Toggle from '../../common/toggle/toggle';
import { RenderError } from '../../common/notification/notification';
import { useCallback, useState } from 'react';
import { useSelector } from 'react-redux';
import { ApplicationStateType } from '../../reducers';
import { filterTestJobsByProject, getTestJobsForSelectedProject } from '../../utils/testJobUtils';
export const useTreeMenuClicked = () => {
const testJobsLibrary = useSelector((state: ApplicationStateType) => state.testJobsLibrary);
const { testProjects, testJobs } = testJobsLibrary;
const testJobsAll = JSON.parse(JSON.stringify(testJobs));
const [testJobFiltered, setTestJobFiltered] = useState(false);
@akkikumar72
akkikumar72 / 3lo.js
Created December 4, 2020 12:58
Atlassian 3LO
/* eslint-disable import/no-extraneous-dependencies */
const express = require('express');
const passport = require('passport');
const AtlassianStrategy = require('passport-atlassian-oauth2');
// Configure Atlassian OOuth2 strategy for use by Passport.
passport.use(new AtlassianStrategy({
clientID: 'keeL5Ne1bv4bwhskjKGRdYZ1kkOgQufz',
clientSecret: 'k-UOpaxpek7kFDIYOg9Z9kbXDlmjyJzSdUohOxLsSy0lCOQyAZxHxgKKd3LtS2gI',
callbackURL: 'http://localhost:8080/auth/atlassian/callback',
@akkikumar72
akkikumar72 / multi-select.js
Created August 30, 2021 12:58
Multi-Select &
import React from 'react';
import Select, { components as Components } from 'react-select';
import './multi-select.scss';
import Checkbox from '../checkbox';
const customStyles = {
container: (provided) => ({
...provided,
width: '60%'
}),
import { useEffect, useState } from 'react';
import { useSelector } from 'react-redux';
import { getUserName } from '../../../../../utils/user-info';
// Virt doesn't have any group
const checkIfVirtHasGroup = (virtGroups, deploymentID) => {
const findMatchingGroupAsPerVirt = virtGroups.filter((p) => p.deployments.includes(Number(deploymentID)));
return findMatchingGroupAsPerVirt.length === 0;
import { getUserName } from '../../../../../utils/user-info';
// Virt doesn't have any group
const checkIfVirtHasGroup = (virtGroups, deploymentID) => {
const findMatchingGroupAsPerVirt = virtGroups.filter((p) => p.deployments.includes(Number(deploymentID)));
return findMatchingGroupAsPerVirt.length === 0;
};
const checkForNormalUser = (virtGroups) => {
return virtGroups?.every((p) => p.users.includes(getUserName()));
@akkikumar72
akkikumar72 / CODE_OF_CONDUCT.md
Created April 20, 2022 05:17
CONTRIBUTING.md

Contributor Covenant Code of Conduct

Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.