Skip to content

Instantly share code, notes, and snippets.

View YaakovHatam's full-sized avatar
🎯
Focusing

Yaakov Hatam YaakovHatam

🎯
Focusing
View GitHub Profile

Write our server

  • Create folder for project

  • Open folder in VSCode (folde should be root folder)

  • npm init -y (for package.json file)

  • create .gitignore and write inside node_modules/

  • create index.js

  • add to package.json the script start that runs the command node index.js

Inside index.js

@YaakovHatam
YaakovHatam / RestAPI.md
Last active May 20, 2022 08:58
REST concept

Rest

Verbs

Verb for body params (req.body) quesrystring params (req.query) URL params (req.params)
GET get entitiy/entities N/A supported supported
POST create entity supported supported supported
PUT update entity supported supported supported
DELETE delete entity N/A supported supported

Examples

@YaakovHatam
YaakovHatam / minecraft-bedrock-on-aws.md
Last active December 19, 2022 04:35 — forked from johntelforduk/minecraft-bedrock-on-aws.md
How to install a Minecraft Bedrock Server on AWS

How to install a Minecraft Bedrock Server on AWS

1. Server software download

Download the .zip from Minecraft website.

Expand the zip and put contents into a code S3 bucket.

2. Security Group

function Calendar(year, name, hourRate) {
this.holidaysDates = holidays(year);
}
function workdaysCount(year) {
let count = 0; const curDate = new Date(year, 0, 1);
const endDate = new Date(year, 11, 31);
while (curDate <= endDate) {
const dayOfWeek = curDate.getDay();
@YaakovHatam
YaakovHatam / ls02.html
Last active October 26, 2021 17:05
4578-20
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>HTML</title>
</head>
<body>
<h1>HTML</h1>
@YaakovHatam
YaakovHatam / main.js
Created August 16, 2021 19:21
chrome extension to catch ctrl+z and perform JS function
document.addEventListener('keydown', function (event) {
if (event.ctrlKey && event.key === 'i') {
var active = document.activeElement;
if (active instanceof HTMLInputElement && active.type == 'text') {
active.value = '200';
}
}
});
/* log out when user exit application */
// beforeunload - will work only for Chrome
// unload - will work for other browsers
$(window).on('unload', function () {
notifyLogOut();
});
$(window).on('beforeunload', function () {
notifyLogOut();
});
function swap(items, leftIndex, rightIndex) {
var temp = items[leftIndex];
items[leftIndex] = items[rightIndex];
items[rightIndex] = temp;
}
function partition(items, left, right) {
var pivot = items[Math.floor((right + left) / 2)], //middle element
i = left, //left pointer
j = right; //right pointer
while (i <= j) {
my music app
plan the relevant APIs for the app , use mocks in the client in order to show the data.
## 1
the main page will show list of music albums
on hover on the album from the main page , the album data will be displayed
on click the album page will be opened .
@YaakovHatam
YaakovHatam / db.sql
Created April 11, 2021 17:31
sql queries
-- phpMyAdmin SQL Dump
-- version 5.1.0
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Apr 11, 2021 at 05:31 PM
-- Server version: 5.7.18
-- PHP Version: 7.3.24-(to be removed in future macOS)
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";