Code

A collection of 36 posts

TypeScript

Better Function Signatures with the Destructuring Assignment

When writing a function sometimes you cannot avoid passing multiple arguments into the function. Lets take a look what is the cleanest way…

  • HappyNeal
TypeScript

Case Study - Add Function - Writing Tests

Assuming we have a function . How can we ensure that the function is doing that what we expect it to do. Expected Result Tests The first and…

TypeScript

Case Study - Add Function in JS vs TS

We are going to take a look at how to implement the “add-numbers” function. The purpose of the “add”-function is to add two numbers, it…

TypeScript

Hello World - A full Tutorial

When you start programming, probably one of the first things you will learn is how to output “Hello World!“. The program is simple to write…

  • HappyNeal
TypeScript

VSCode TypeScript debugging

The VS Code debugger is pretty awesome. You can learn more about it in the official guide. If you want to debug typescript it does not work…

TypeScript

Setting up TypeScript and Jest

We will take a quick look at how to set up a project using TypeScript and Jest. By adding Jest to the project from the beginning this should…

TypeScript

Getting started with MOBX 5 and TypeScript 3, React 16.6

When looking around for example applications that use Mobx 5.x combined with Mobx-react 5.x and TypeScript 3.x I did not find any useful…

Code

Setting up a dev environment to learn TypeScript

TypeScript is basically JavaScript with types. When writing your code you must define the types of your variables and optionally the returns…

Java

Dealing with the new Java Release Schedule

Oracle has just announced that the End of Support for Java 8 is going to be in January 2019. This, in turn, means that every business using…

Code

HTML: How to control the Form ‘autofill’-autocompetion

Image Designed by Freepik The ‘autofill’ feature of browsers is a blessing and a curse. The feature enables the browser to reuse the data…

Code

MOBX to Redux-Toolkit

Ever since React Introduced Hooks it is more elegant to simply write functional components. Today I will transition my MOBX example Project…

Code

How to publish on Github Pages with create-react-app and react-router

Now I will be assuming a couple of things: You have a GitHub account and you created a repository for your app. You created a react app…

NPM

NPM: windows-build-tools

node-gyp is really useful and annoying. fails if Python 2.7 and a C# Compiler is missing. You could use to get and install the missing…

Code

Puppeteer.JS - Using Headless Chrome for Site Crawling

PuppeteerJS essentially allows you to automate Chrome. Headless Chrome allows you to run Chrome without actually rendering the webpage…

Web Development

VSCode: Launch create-react-app and Chrome with launch.json

Developing React (with create-react-app) and Visual Studio Code you usually press and then . The script from create-react-app then…

NPM

package.json: Updating Fixed Versions with npm-check

One of the common problems when running a larger project is that you need to use fixed versions in your package.json file. But at the same…

NPM

Git: Hooks run `npm install` on checkout

When working on a project you usually install various packages from NPM. Of course, these packages are maintained and updated, adding more…

Code

Web Tooling and Automatization using gulp 4

Now working with Gulp you will discover that you run into a couple of minor problems. Especially in sequencing the different types of tasks…

Code

HTML 5: When to use <a> or <button>

tl:dr is used for page navigation is used for actions on the page is used in a form and the value is used in the form The Problem Let’s…

Java

JSP: Passing Variable Data to JavaScript

When you try to marry old JSP Technology with the modern wonders of Typescript/ES6. You will want to expose some data provided by the…

Code

Udacity: Web Tooling and Automatization

I recently took a look at the course materials for Web Tooling and Automatisation. Overall the course is very well structured and introduces…

NPM

NPM: Use Github Patch Instead of Repository

Recently I was playing around with the HEXO static site generator. For my setup, I was using Hexo in combination with Gitlab CI and the ftp…

Code

Continuous Integration (CI) for Gitbook using Gitlab and Gulp

Gitbook is a static site generator, that converts a collection of Markdown files into an HTML Site. Alternatively, it can also convert the…

Java

Notes on MITx: 6.005.1x Software Construction in Java (Week 2)

This week the course is covering another two very important topics: Testing and Specifications. LECTURE 3: Testing Testing is a very…

Java

Notes on MITx: 6.005.1x Software Construction in Java (Week 1)

MITx has released a course titled “Software Construction in Java”. The course is aimed at more experienced Developers and is going to teach…

Web Development

Getting Started using AngularJS with Yeoman and Visual Studio Code

Typically to get started with a web-project you would start downloading libraries, configuring grunt etc. Yeoman is a project that takes…

Internet Explorer

Forcing IE 10 to render pages as IE 10

Now isn’t that a silly title, sadly it’s one of those things I never thought I would have to deal with. Especially as Internet Explorers…

Java

Java: Multiple Functions and one ErrorHandler

Let’s say you have function and function both functions are very similar and throw similar errors. If you have the possibility to avoid…

Python

Google App Engine: Import CSV to Datastore

Processing CSV Data with the Google App Engine is a two-step process. First, you need to upload the data and store it in the blob store…

Python

PySide: QPushbutton Text below Icon

Apparently using a QPushbutton with an Icon does not work. As alternative, I am going to use a QToolbutton.

Python

PySide: QVBoxLayout with QScrollArea

Here is an example that adds Scrollbars to a QVBoxLayout. The one thing that tripped me up was that you need to explicitly create a Widget…

Python

PySide: QTreeListWidget deleting an Item, editing an Item

This example creates a QTreeListWidget to display a folder-structure.

Python

PySide: Using standard system Icons

You can add Icons to many types of QWidgets. PySide provides you with a method to access the native system icons. A complete list of icons…

Python

PySide: QMessageBox with QCheckBox

The QMessageBox is very useful for creating standard filesystem dialogs (it even comes with alert sounds) and is limited to display an icon…

Python

PySide: Rightclick Button Menu

PySide (www.pyside.org) is an awesome Framework that allows you to use Qt with Python. Installation is as straightforward as typing I will…

Java

Java GUI: Using AbstractTableModel

When using the you need to store the table data as a Vector of Vectors. This is my helper function to insert new data. Here is the example: