Writings about code

Sometimes I write about code and design. I am always exploring new tools and technology.

Zagreb local election predictions

I used Neural Networks and basic Machine Learning classification algorithms...

library(caret)
library(mlbench)
library(C50)
library(dplyr)

Responsive CSS counter without Javascript

CSS counters let you adjust the appearance of content based on...

@media (max-width: 319px) {
    .small-card__item:nth-child(1)~.small-card__item {
        counter-increment: item-count;
    }
}

Bulker – Face recognition script

Imagine that we have thousands of images inside of a...

def get_ref_face(self, ref_image_path):
        try:

Short-circuits conditionals

If you have to execute a function only if condition...

// You can use short-circuit
condition && doSomething();

Croatia recession prediction

This LSTM recurrent neural network learns to predict Croatia economic...

pred.train_LSTM()
pred.evaluate_LSTM()
pred.display_results(

Simple Nodejs watcher

I built a simple Nodejs watcher that is syncing changes...

const dataCsv = './sample_data.csv';
const mongodb = require("mongodb").MongoClient;
const csvtojson = require("csvtojson");
const fs = require('fs');
let url = "mongodb://yoururl";

Svelte is really cool

Svelte is a radical new approach to building user interfaces....

let count = 0;
   $: if (count >= 10) {
       alert(`count is dangerously high!`);
        count = 9;
}

Center div vertically and horizontally with CSS

Let’s say that we want to center a div inside...

body {
   display: grid;
   place-items:center;
}

The :valid CSS pseudo-class

The :valid CSS pseudo-class represents any  <input> or other <form> element whose...

input:valid {
  background-color: powderblue;
}

Target pseudo-class

This pseudo-class is called target pseudo-class and represents an element...

:target {
    outline: red dotted;
}

How to create a unique list of elements using the Set object

Creating unique lists in javascript is a common task, this...

const list = [1, 2, 3, 5, 2, 5, 7];

Error handling with ExpressJS

Error Handling refers to how Express catches and processes errors...

app.get('/', function (req, res, next) {
  fs.readFile('/file-does-not-exist', function (err, data) {
})

Simple Todo app with Node.js and Express

In this quick tutorial we will be creating a Todo...

app.listen(8080, function () {
  console.log('Running on port 8080!')
});

How to write middleware for Express.Js apps

Middleware functions are functions that have access to the request...

var logger = function (req, res, next) {
  console.log('logged')
  next()
}

Routing in Node.js with Express.Js

In this post I will try to explain how routing...

app.get('/', function (req, res) {
  res.send('hello from me')
})

Top 5 NodeJs Frameworks to Use

Node.js is used to build fast, highly scalable network applications...

app.get('/', function (req, res) {
  res.send('Hello World!')
})

Simple REST API with ExpressJS

Express is a minimal and flexible Node.js web application framework...

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));

How to apply single quotes around every value using VS code?

I often work with large documents and very often I...

'Nick',
'Ivan'

Random name picker with Javascript

My wife and I will become parents. I believe most...

?

start
stop

Remove duplicate elements from list by value with jQuery

jQuery is very useful and easy to learn and it’s...

.list {
  list-style:none;
}

Weather app with Vuejs

In this app I’m going to build a weather app...

var vm = new Vue({
  // options
})

How to block F12 key with jQuery

In this post, I will show you how to disable...

$(document).on("contextmenu",function(e){        
   e.preventDefault();
});

Awesome reponsive table

Recently I had one custom CRM project where I had...

.responsive-table tbody td[data-title]:before {
    content: none;
  }

How to count words in each paragraph

Sometimes you need a number of words for a certain...

  var iTotalWords = $(this).text().split(' ').length;
Get In Touch

Feel free to contact me