Skip to content

Instantly share code, notes, and snippets.

View Ebazhanov's full-sized avatar
👋

Evgenii Bazhanov Ebazhanov

👋
View GitHub Profile
import React from "react";
// define a Navigation Link type for our links
export type NavLinkPropType = {
label: string;
route: string;
};
const AppHeaderNavLink: React.FC<NavLinkPropType> = ({ label }) => {
return <span className="nav-link">{label}</span>;
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
const adventurer = {
name: 'Alice',
cat: {
name: 'Dinah'
}
};
const dogName = adventurer.dog?.name;
// ***********************************************
// This example commands.js shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-commands
// ***********************************************
//
function getRoute (tickets) {
const route = tickets.pop();
let i = 0;
while (i < tickets.length) {
if (route[0] === tickets[i][1]) {
route.unshift(tickets[i][0]);
i = 0;
} else if (route[route.length - 1] === tickets[i][0]) {
route.push(tickets[i][1]);
i = 0;
@Ebazhanov
Ebazhanov / quotes.json
Last active July 16, 2022 21:43
quotes.json
[
{
"quote": "Inspiration is the windfall from hard work and focus.",
"author": "Helen Hanson"
},
{
"quote": "Life isn’t about getting and having, it’s about giving and being.",
"author": "Kevin Kruse"
},
{
@Ebazhanov
Ebazhanov / main.yml
Last active May 31, 2021 06:12
GitHub Actions job - Cypress scheduled job
#https://github.com/marketplace/actions/schedule-job-action
name: scheduled job
on:
schedule:
#https://crontab.guru/#0_0_*_*_*
- cron: "0 0 * * *"
jobs:
#https://docs.cypress.io/guides/continuous-integration/github-actions#Cypress-GitHub-Action
chrome:
runs-on: ubuntu-latest
@Ebazhanov
Ebazhanov / cypress-circleci-nightly-scheduled-job.yml
Last active November 25, 2022 17:11
Schedule CircleCI job for Cypress
#https://docs.cypress.io/guides/continuous-integration/circleci#Basic-Setup
version: 2.1
orbs:
cypress: cypress-io/[email protected]
workflows:
build:
jobs:
- cypress/run:
#https://circleci.com/docs/2.0/contexts/
context: keep-password-secret
@Ebazhanov
Ebazhanov / app.js
Created May 30, 2020 10:31
app.js quiz improvments
import React, {Component} from 'react';
import quizQuestions from './api/quizQuestions';
import Quiz from './components/Quiz';
import Result from './components/Result';
import logo from './svg/logo.svg';
import './App.css';
class App extends Component {
constructor(props) {
super(props);
@Ebazhanov
Ebazhanov / Javascript Promise
Last active May 18, 2020 12:06
One of the example how to use promise (with async code) in javascript
=========WITHOUT PROMISE====================
console.log('Request data...')
setTimeout(() => {
console.log('Preparing data...')
const backendData = {
server: 'aws',
port: 2000,
status: 'working'
@Ebazhanov
Ebazhanov / is:issue is:open
Created April 23, 2020 20:10
Direct GitHub searches. -> Search links that point directly to suitable issues to contribute to on GitHub.
is:issue is:open label:beginner
is:issue is:open label:easy
is:issue is:open label:first-timers-only
is:issue is:open label:good-first-bug
is:issue is:open label:"good first issue"
is:issue is:open label:starter
is:issue is:open label:up-for-grabs