Browsed by
Category: Programming

Posts

WordPress – add custom widgets on home page

WordPress – add custom widgets on home page

I once had a desire to provide a list of shortcuts on the home page for my blog’s new users. I didn’t like the default WordPress’ blog page to be just a list of posts. I didn’t think that sidebar widgets grouping posts by date, category or tag would be helpful enough to grasp the versatility of the topics I cover here. I wanted to display a clear list of links with what a user can read about.

Read More Read More

GitHub contribution by Pull Request – crash course

GitHub contribution by Pull Request – crash course

If you want to fix an issue or enhance others’ GitHub repository, don’t be afraid – it’s fairly simple. I will show by example all the steps that are necessary.

I wanted to add support for two languages (TypeScript and JSON) to a WordPress plugin providing a Code block. You can read more about my choice and configuration in WordPress for developers – displaying source code and review of code sharing services.

Read More Read More

Add Jasmine unit testing support to Angular in StackBlitz

Add Jasmine unit testing support to Angular in StackBlitz

I mentioned StackBlitz in the post about online code editors. This service allows for creating i.a. running Angular applications. Once I wanted to execute unit tests written in Jasmine inside it, and I hit a lot of troubles. Finally, I managed to resolve them all.

Read More Read More

Angular CLI: Different ways to include assets

Angular CLI: Different ways to include assets

In this article I will discuss several methods of adding and referring to static files in an Angular CLI application – may they be images, fonts or scripts:

  • when the assets are in the assets folder
  • when the assets are in any other folder
  • when the assets are in the node_modules folder

Read More Read More

UX: wireframe, low fidelity, high fidelity, mockup, prototype

UX: wireframe, low fidelity, high fidelity, mockup, prototype

This article is part of User Interface (UI) and User Experience (UX) dictionary.

Page’s interface can be designed with various level of detail and purpose. Below you can find several common terms used in UI/UX design: low-, medium-, high-fidelity wireframe, prototype and mockup.

Read More Read More

Duplicated ng-content and *ngTemplateOutlet

Duplicated ng-content and *ngTemplateOutlet

Recently (Angular component with varying appearance) I wrote how to use the same <ng-content> twice in a switch case.

Today I hit upon explanation of this fact in a GitHub issue (https://github.com/angular/angular/issues/22972) and I found another problem.

Namely, it is not possible to display at the same time twice the same <ng-content> even if it is packed inside a <ng-template>. Therefore the following example will not work:

Read More Read More

JavaScript: converting values to boolean or what is false and what is true

JavaScript: converting values to boolean or what is false and what is true

What will !x return? And !!x? It depends on what is x

!x will convert any value to a boolean, and !!x will negate the previous value. When x is a boolean, !x is its negation and !!x is back the original value x. But for other types, some magic happens thanks to auto conversion.

What exactly? I’ll explain in several cases. JavaScript recognizes 7 primitive data types, of which the most prominent ones are:

Read More Read More