Skip to content

Instantly share code, notes, and snippets.

Avatar

Solijon Sharipov Solijons

View GitHub Profile
View useHttpReactHook.ts
import { useCallback, useReducer } from 'react';
const initialState = {
error: null,
extra: null,
data: null,
identifier: null,
loading: false,
};
View ComplexNumber.txt
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 Oct 26, 2021
Example of using docker-compose.
View docker-compose.yml
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 Dec 24, 2018
Dinamic Behavior
View feedster.js
$(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')
})
View effects.js
$(document).ready(() => {
$('.hide-button').on('click', () => {
$('.first-image').hide();
});
$('.show-button').on('click', () => {
$('.first-image').show();
});
@Solijons
Solijons / dropdown
Created Dec 24, 2018
Jquery practice
View dropdown
$(document).ready(() => { // func
$('#cart').on('click', () => { // callback func
$('#cartMenu').show(); // method show
})
$('#account').on('click', () => {
$('#accountMenu').show();
})
$('#help').on('click', () => {
$('#helpMenu').show();
})