Skip to content

Commit 2a58cd4

Browse files
committed
prvi commit
0 parents  commit 2a58cd4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+57812
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

1-node/.DS_Store

6 KB
Binary file not shown.

1-node/dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:18
2+
WORKDIR /app
3+
COPY package.json /app
4+
RUN npm install
5+
COPY . /app
6+
EXPOSE 80
7+
CMD ["node", "server.js"]

1-node/package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "docker-complete",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "server.js",
6+
"author": "Aleksa Miletić",
7+
"license": "MIT",
8+
"dependencies": {
9+
"express": "^4.17.3",
10+
"body-parser": "1.19.0"
11+
}
12+
}

1-node/public/styles.css

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
html {
2+
font-family: 'Arial', sans-serif;
3+
}
4+
5+
body {
6+
margin: 0;
7+
background-color: #f4f4f4;
8+
display: flex;
9+
align-items: center;
10+
justify-content: center;
11+
height: 100vh;
12+
}
13+
14+
section,
15+
form {
16+
padding: 2rem;
17+
border-radius: 8px;
18+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
19+
background-color: #ffffff;
20+
margin: 2rem;
21+
max-width: 30rem;
22+
}
23+
24+
.form-control {
25+
margin: 1rem 0;
26+
}
27+
28+
input {
29+
font: inherit;
30+
width: 100%;
31+
padding: 0.5rem;
32+
border: 1px solid #ccc;
33+
border-radius: 4px;
34+
}
35+
36+
input:focus {
37+
outline: none;
38+
border-color: #ff9800;
39+
}
40+
41+
input,
42+
label {
43+
display: block;
44+
}
45+
46+
label {
47+
font-weight: bold;
48+
margin-bottom: 0.5rem;
49+
color: #ff9800;
50+
}
51+
52+
button {
53+
background-color: #ff9800;
54+
border: none;
55+
color: white;
56+
cursor: pointer;
57+
padding: 0.75rem 1.5rem;
58+
border-radius: 4px;
59+
}
60+
61+
button:hover,
62+
button:active {
63+
background-color: #ffac33;
64+
}

1-node/server.js

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
const express = require("express");
2+
const bodyParser = require("body-parser");
3+
4+
const app = express();
5+
6+
let userWishlist = "Napiši svoju listu želja!";
7+
8+
app.use(
9+
bodyParser.urlencoded({
10+
extended: false,
11+
})
12+
);
13+
14+
app.use(express.static("public"));
15+
16+
app.get("/", (req, res) => {
17+
res.send(`
18+
<html>
19+
<head>
20+
<link rel="stylesheet" href="styles.css">
21+
</head>
22+
<body>
23+
<section>
24+
<h2>Moja lista želja!!</h2>
25+
<h3>${userWishlist}</h3>
26+
</section>
27+
<form action="/store-wishlist" method="POST">
28+
<div class="form-control">
29+
<label>Element liste:</label>
30+
<input type="text" name="wishlistItem">
31+
</div>
32+
<button>Dodaj u listu</button>
33+
</form>
34+
</body>
35+
</html>
36+
`);
37+
});
38+
39+
app.post("/store-wishlist", (req, res) => {
40+
const enteredWishlistItem = req.body.wishlistItem;
41+
console.log(enteredWishlistItem);
42+
userWishlist = enteredWishlistItem;
43+
res.redirect("/");
44+
});
45+
46+
app.listen(80);

2-python/dummy/test/text.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello!

2-python/dummy/text.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello!

2-python/rng.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
from random import randint
2+
3+
min_number = int(input('Please enter the min number: '))
4+
max_number = int(input('Please enter the max number: '))
5+
6+
if (max_number < min_number):
7+
print('Invalid input - shutting down...')
8+
else:
9+
rnd_number = randint(min_number, max_number)
10+
print(rnd_number)
11+

3-volumes/.DS_Store

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)