Skip to content

Instantly share code, notes, and snippets.

View Solijons's full-sized avatar

Solijon Sharipov Solijons

View GitHub Profile
import { useCallback, useReducer } from 'react';
const initialState = {
error: null,
extra: null,
data: null,
identifier: null,
loading: false,
};
@Solijons
Solijons / ComplexNumber.txt
Last active January 26, 2023 05:57
Challenge
A complex number is a number that can be expressed in the form of a + bi, where a and b are real numbers, and i is solution of the equation x2 = -1. Because no real number satisfies this equation, i is called an imaginary number. For the complex number a + bi, a is called the real part, and b is called the imaginary part. To add or subtract two complex numbers, just add or subtract the corresponding real and imaginary parts. For instance, the sum of 5 +3i and 4+2i is 9 + 5i. For another, the sum of 3 + i and -1 + 2i is 2 + 3i.
Write a class with name ComplexNumber. The class needs two fields with name real and imaginary of type double. It represents the Complex Number.
The class needs to have one constructor. The constructor has parameters real and imaginary of type double and it needs to initialize the fields.
Write the following methods
Methods named getReal without any parameters, it needs to return the value of real field.
Method named getImaginary without any parameters, it needs to return the value
@Solijons
Solijons / docker-compose.yml
Last active October 26, 2021 19:15
Example of using docker-compose.
version: '3'
services:
postgres:
image: postgres:12.1
ports:
- "5432:5432"
environment:
POSTGRES_PASSWORD: mypassword
volumes:
- ./postgresql/data:/var/lib/postgresql/data
@Solijons
Solijons / feedster.js
Created December 24, 2018 03:46
Dinamic Behavior
$(document).ready(() => {
$('.menu').on('mouseenter', () => {
$('.nav-menu').show()
}).on('mouseleave', () =>{
$('.nav-menu').hide();
});
$('.btn').on('mouseenter', (event) => {
$(event.currentTarget).addClass('btn-hover').on('mouseleave', event => { $(event.currentTarget).removeClass('btn-hover')
})
@Solijons
Solijons / effects.js
Created December 24, 2018 02:37
Jquery effects
$(document).ready(() => {
$('.hide-button').on('click', () => {
$('.first-image').hide();
});
$('.show-button').on('click', () => {
$('.first-image').show();
});
@Solijons
Solijons / dropdown
Created December 24, 2018 02:23
Jquery practice
$(document).ready(() => { // func
$('#cart').on('click', () => { // callback func
$('#cartMenu').show(); // method show
})
$('#account').on('click', () => {
$('#accountMenu').show();
})
$('#help').on('click', () => {
$('#helpMenu').show();
})