Skip to content

Instantly share code, notes, and snippets.

View MihailoJoksimovic's full-sized avatar

Mihailo Joksimovic MihailoJoksimovic

View GitHub Profile
@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
PS1='\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\033[0;36m\]\w\[\e[0m\]$(__git_ps1 " (%s)")\$ '
<?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);
console.log('script start')
const interval = setInterval(() => {
console.log('setInterval')
}, 0)
setTimeout(() => {
console.log('setTimeout 1')
Promise.resolve().then(() => {
console.log('promise 3')
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);
<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>
HTML kod pasteujes ovde
bla bla bla
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1