## Getting started with pytest

##### Jan 28, 2019

Test-Driven Development is great. If you’re a Pythonista, it gets even better with pytest - a framework that makes building simple and scalable tests easy.

In this series, I’ll be exploring the cool features that pytest offers to help make testing Python code a breeze.

## Python's heapq module

##### Dec 21, 2018

Often when working with collections of data, you may want to find the smallest or largest item. It’s easy enough to write a function that iterates through the items and returns the smallest or largest one, or use the builtin `min()`, `max()`, or `sorted()` functions. Another interesting way may be implementing a heap (priority) queue.

Python provides a pretty convenient module called `heapq` that does that for you. `heapq` comes with a cool set of inbuilt functions that you can read more about in the docs.

## Sorting Algorithms with Javascript (Part 2)

##### Nov 04, 2018

I’m going to show Javascript implementations of three more sorting algorithms:

• Quick sort
• Heap sort
• Counting sort

Again, this is not intended to be an in-depth explanation on the ins and outs of how the algorithms work and their performance. If you’d rather read about that, here’s a nice resource I found: Sorting Algorithms

## Sorting Algorithms with Javascript (Part 1)

##### Oct 18, 2018

I’ve been learning a lot about data structures and algorithms lately and I’ve noticed in my reading that there aren’t a lot of examples showing implementations of algorithms in Javascript. You’ll mostly find examples in Java, Python, C, C++ etc. Maybe there’s a reason for preferring these languages over Javascript? I’m not sure.

In this first part, I’m going to show Javascript implementations of three sorting algorithms:

• Merge sort
• Insertion sort
• Bubble sort

This is not intended to be an in-depth explanation on the ins and outs of how the algorithms work and their performance. If you’d rather read about that, here’s a nice resource I found: Sorting Algorithms

##### Aug 29, 2018

Regular expressions are patterns used to match character combinations in strings. They help us work with strings in a very performant way.

By formulating regex with a special syntax, you can:

• search text in a string
• replace substrings in a string
• extract information from a string

If all this is completely new to you, take a look at the mdn web docs for more info.

For this post, I’ll focus on one of the easier (and very useful) ways you can use regex.

## Javascript array iteration with some() and every()

##### Aug 28, 2018

If you’re using an array in your code, chances are, you’ll need to iterate over the values in the array. There’s a couple of ways you can do that, some better and more efficient than others depending on what you want to accomplish.

For this post, I’ll focus on two ways: `some()` and `every()`.

## `this` and arrow functions

##### Aug 27, 2018

Arrow functions were introduced in ES6 as a new syntax for writing Javascript functions. Thanks to their short syntax, they encourage the use of small functions, which make code look cleaner (and `() =>` just looks cooler 😄).

## Finding an element in the array (the ES5, ES6 and ES7 way)

##### Aug 26, 2018

This’ll be a quick one.

Say you want to check if a specific element exists in an array. There’s a couple of ways to do that: