Skip to content

Instantly share code, notes, and snippets.

View MihailoJoksimovic's full-sized avatar

Mihailo Joksimovic MihailoJoksimovic

View GitHub Profile
HTML kod pasteujes ovde
bla bla bla
<html>
<head>
<script src="ime-fajla.js"></script>
</head>
<body>
<button onclick="play(1);">Papir</button>
<button onclick="play(2);">Kamen</button>
<button onclick="play(3);">Makaze</button>
var userChoice = ["paper", "rock", "scissors"];
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = userChoice[1];
} else if(computerChoice <= 0.67) {
computerChoice = userChoice[0];
} else {
computerChoice = userChoice[2];
} console.log("Computer: " + computerChoice);
console.log('script start')
const interval = setInterval(() => {
console.log('setInterval')
}, 0)
setTimeout(() => {
console.log('setTimeout 1')
Promise.resolve().then(() => {
console.log('promise 3')
<?php
// Run the script below and try doing anything in your MongoDB
$client = new \MongoDB\Client('mongodb://localhost');
$cmd = new \MongoDB\Driver\Command(['eval' => 'sleep(20000)']);
$client->getManager()->executeCommand('foobar', $cmd);
PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\033[0;36m\]\w\[\e[0m\]$(__git_ps1 " (%s)")\$ '
@MihailoJoksimovic
MihailoJoksimovic / gist:04158ddaa1427cdb96202b69c3acf066
Last active August 6, 2019 09:02
This is my quick evaluation of Laravel vs Symfony frameworks; the task was intentionally simple --> build simple API returning JSON responses and three simple routes. Observations below
Laravel:
1. What I liked:
1. Super-easy initial setup
2. Working with Eloquent is pretty damn easy
3. Repository pattern implemented quite easily
4. Seems to be working pretty fast (in comparison to Symfony)
5. Feels pretty friendly and easy going. BUT:
2. What I dislike:
1. From the moment #1, I feel like Eloquent is forcing me to think about DB and relations. I don’t want that. I want to think about OBJECTS first, and think about persistence separately