Skip to content

Instantly share code, notes, and snippets.

View dmelechow's full-sized avatar
🚀

Dmitriy dmelechow

🚀
View GitHub Profile
@dmelechow
dmelechow / gist:18c174b5f8d919a6fddb23c954837167
Created May 8, 2024 09:52
git commands for working with branches history
# Remove all megred branches locally
git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
# Remove all local branch if there is no origin version. (It means remote branch was merged and removed)
for local_branch in $(git branch);
do
if ! git branch -r | grep "origin/$local_branch" &>/dev/null; then
git branch -D "$local_branch"
fi
@dmelechow
dmelechow / ReactJs junior test
Created June 3, 2020 13:31
Прогноз погоды
Используя API прогноза погоды https://openweathermap.org/api сделать небольшое приложение на ReactJS, которое получает прогноз погоды для введенного города
Иконка должна меняться в зависимости от того что приходит в ответе от сервера. Если солнечно или облачно без дождя рисовать солнце, если дождь то тучи с дождем.
Если сила ветра больше 10 мс то писать - "Лучше не выходить, тк сильный ветер"
Для выполнения задания необходимо освоить как создавать приложение используя инструмент
https://ru.reactjs.org/docs/create-a-new-react-app.html
Изучить как создавать свои компоненты https://ru.reactjs.org/docs/getting-started.html и использовать JSX вертску
@dmelechow
dmelechow / http code
Created November 26, 2019 19:34
http code
Status Code Constructor Name
400 BadRequest
401 Unauthorized
402 PaymentRequired
403 Forbidden
404 NotFound
405 MethodNotAllowed
406 NotAcceptable
407 ProxyAuthenticationRequired
408 RequestTimeout
.parent {
position: fixed;
top: 50%;
transform: translateY(-50%);
}
.child {
position: absolute;
top: 10px;
right: 10px;
var https = require('https');
var http = require('http');
var fs = require('fs');
var options = {
key: fs.readFileSync('./localhost.key').toString(),
cert: fs.readFileSync('./localhost.crt').toString(),
ciphers: 'ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384',
honorCipherOrder: true,
1. npm init
2. npm install express
3. node index.js
content of index.js
const express = require('express')
const app = express();

Git Commands

Getting & Creating Projects

Command Description
git init Initialize a local Git repository
git clone ssh://git@github.com/[username]/[repository-name].git Create a local copy of a remote repository