5-javascript-tips-everyone-should-learn

5 JavaScript Tips and Tricks Every JS Developer Should Know

JavaScript is language that is certainly full of flaws (what a horrible way to start an article!) as much as it is full of pleasant surprises. This short post will focus more on the second part. I’ll show you 5 JavaScript tips and tricks that you should know as someone who works with JS: on the backend or the frontend. These little tricks will help you avoid some common pitfalls and write better code.

(more…)

Read More

100 Prisoners and 50 Lockers Intro

The 100 Prisoners and 50 Lockers Puzzle – an Exercise in Probability, Combinatorics and Cycles

The 100 Prisoners Problem (also known as “The 50 Lockers Puzzle”) is a mathematical problem in probability theory and combinatorics. It’s also a fun (but difficult) puzzle for the curious mind. In this blog post, I will provide an overview of the problem and present a few observations before revealing the final solution.

Overview of the 100 Prisoners Problem

Let’s imagine that we have 100 prisoners. Each one has their own distinct number from 1 to 100 (their index if you will). Each one of these prisoners is on death row and the director of the prison is a cruel trickster and a betting man. He offers the prisoners one last ditch effort to escape. (more…)

Read More

How_to_Use_Math_max_JavaScript

How to Use and Over-think the Math.max JavaScript function

In this article we’ll go over the Math.max JavaScript functions in JavaScript and explore all the neat little tricks and programming caveats that come with these simple functiosn. I’ll show you how to use it with numbers, arrays and objects. If you are well familiar with how Math.max works then you can skip down to the fun part (there’s a lot of interesting caveats in this one!) If you’ve never really used this function, then it might be good for you to read the whole piece.

(more…)

Read More

The 7 Day Web Dev Challenge on CodePen

Lately I’ve been working on projects and problems that aren’t related to the field of web development and I’ve started to feel my touch slipping. Naturally, in such a situation you need to find a way to keep you skills up-to-date without using too much time. As such, I decided to do my first 7 day web dev challenge and I’ll be posting my results on CodePen.

The idea is to do a fun pen every day for seven days in a row. It’s not a very difficult task for a lot of you who are probably reading this, but when you are very short on time it can be a bit of challenge. Let’s look at the plan so far, shall we?

Planned challenges (you can see the results with comments and tips below this list): (more…)

Read More

Pure CSS3 Spinner Animation via Transform:Rotate (CodePen Snippet #3)

Today’s snippet will show you how to create a fun and practical CSS3 spinner animation. Technically, you can use something like this for your loading screens which is pretty nifty since you (for example) won’t have to use any GIFs or SVGs. It’s been a while since my last Codepen snippet so I knew I had to come back to the blog with something brand new and exciting.

I’ve been playing around with various transform properties and I’ve found that you can create some pretty cool things using rotate and scale. Let’s look at the final result and then we’ll look at the code. Here’s the preview:

(more…)

Read More