Linting Markdown Syntax

Linting is the process to check code for potential errors and enforce a style guide, but linting is not just for code; you can lint markdown documents for the same reasons. Markdownlint is a Node package to lint markdown syntax, use markdownlint-cli for use on the command-line, or use the Visual Studio Code plugin for […]

Build a Block Series – Part 7: Placeholder

In this seventh part, I do away with screencasting and work on improving the editor interaction with the QRCode block. Specifically, showing in the editor how the QRCode will look when published. Previous screencasts: Development Environment WordPress Plugin Anatomy of a Block Block Attributes ES6+ Syntax QRCode Intro One of the primary tenets of Gutenberg […]

Unix Crontab

Introduction cron is a utility that you can use to schedule and automate tasks. By defining items in the cron table, called crontab, you can schedule any script or program to run on almost any sort of schedule. A few examples: Download RSS feeds daily at 6:30am, Run a program 5 minutes after midnight on […]

Build a Block Series – Part 6: QRCode

In this sixth screencast I get down to implementing the QRCode part of the block: loading the qrcode.js library and trigger it using the saved URL to create a QRCode. Previous screencasts: Development Environment WordPress Plugin Anatomy of a Block Block Attributes ES6+ Syntax QRCode Implementation In the cast, I alter the block’s save function […]

Build a Block Series – Part 5: ES6+ Syntax

The fifth part of my series walking through building a Gutenberg block for the WordPress editor. This part takes a break from new block development to explain some features of ES6+ syntax used, specifically Destructuring assignments, Arrow functions, and Imports. Previous screencasts: Part 1: Development Environment Part 2: WordPress Plugin Part 3: Anatomy of a […]

Build a Block Series – Part 4: Block Attributes

The third part in my series walking through building a Gutenberg block for the WordPress editor. This lesson continues the anatomy of a block, specifically a block attributes. Previous casts: Development Environment WordPress Plugin Anatomy of a Block Block Attributes Attributes are the way a block stores data, they define how a block is parsed […]

Build a Block Series – Part 3: Anatomy of a Block

The third part in my series walking through building a Gutenberg block for the WordPress editor. This lesson covers the anatomy of a block. Previous casts: Development Environment WordPress Plugin Anatomy of a Gutenberg Block At its simplest, a block in Gutenberg is a JavaScript object with a specific set of properties. Here is the […]

Build a Block Series – Part 2: WordPress Plugin

The second part of my series walking through building a Gutenberg block for the WordPress editor. See Part 1: Development Environment. Part two covers creating a WordPress plugin and setting up the JavaScript build for block development. After this part, all the pieces are in place to start creating a block. WordPress Plugin A WordPress […]

Build a Block Series – Part 1: Development Environment

I’m kicking off a new series of screencasts for building a Gutenberg Block for the WordPress Editor. The intended audience is a developer who may not have experience with WordPress and/or JavaScript, so introductory level. The series will focus on building a QRCode block, that I have an idea for but have not yet built. […]

Good first issue on Gutenberg

This post and screencast walks through the process for how you can make your first contribution to Gutenberg. I walk through all my steps to submit this Gutenberg PR#18175 This follows up on my previous screencast for creating a Storybook story for Gutenberg components. Steps 1. Find issue to work on. Search using the good […]

Coding a Storybook Story

Being inspired by my colleague Jon Q videos for building a Gutenberg Component. I wanted to try my own, just focused on building the story part for Storybook. Q’s videos are great, they go deep into the thinking and details for designing components and a large component design system. My screencast is just short and […]

Working with Vim

A set of vim tips and features I use often, the goal is to help you improve your fluency with vim. I initially titled this post “Intermediate Vim” but experiences vary and non-linear, so what may be intermediate for some is basic or advanced for others. A basic understanding of vim is a prerequisite, I […]

My Debugging Process

Here is the process I go through when trying to debug a tricky coding problem. First, I run a private personal blog which I use for debugging and taking coding notes. You can consider this your coding journal, and whatever tool works for you. I find something digital works better, since you can use HTML […]

Ubuntu Guide for Mac Converts

Here are some tips and tricks to help Mac users adjust to Ubuntu and Linux. I was a die hard Mac user ever since OS X was released in 2001. The combination of a Unix core and real desktop apps was a perfect match for desktop and development. However times change, with Apple’s focus on […]

Beyond Ad Blocking

Ad blockers are one way to make the internet a slightly nicer place. However,  more can be done, especially when it comes to helping yourself from making bad decisions, like reading the comments. First, you need a browser extension which allows you to run your own CSS. The most popular is probably Stylish which has […]

Unix is my IDE

An integrated development environment (IDE) such as PHPStorm, Eclipse or Netbeans provides a set of tools and integrations available together to make development easier. Common features are: Text Editor Project search and replace Automatic building, testing, linting Source control integration The command-line meets all of these features. Editor First, my text editor is vim. I […]

Git Snippets

Undo If you made a commit and did not push and want to change, use reset it will unstage the commit and your repo will be at the state prior to the commit. You can use reset with a hash or ~ back from head. If you want to completely undo the previous commit, backing […]

IP Address

It is possible to represent an IPv4 address in different formats than the common x.x.x.x notation. An IPv4 address is simply a 32-bit number, or a 4-byte number with each section representing a byte. For example using my mkaz.com IP address: 45.79.78.169 Converting each part to binary: Decimal Binary Hex 45 00101101 2D 79 01001111 […]

Code Signing a Windows application

Today, we released our WordPress.com Desktop app on Windows, the app takes advantage of all the work put in creating the Calypso app which is the Javascript client code that powers WordPress.com, which is all open source. To build the desktop apps, we use Electron which bundles Javascript, Node and the Chromium browser together into […]

Testing Clients to an HTTP API in Go

An example on how to test a client which calls out to an external API, without requiring the API server to be up and running. From Testing Techniques video by Andrew Gerrand at Google I/O 2014. Go has a standard library net/http/httptest which you can use to create a test HTTP server, similar to Go’s […]

Python Argparse Cookbook

I use Python as my go-to tool for command-line scripts, these often requiring parsing command-line arguments. Since I use various programming languages I don’t remember anything, so I create reference docs for myself and hopefully others. So similar to my Python String Format Cookbook, that is examples for string and number formatting, I wrote this […]

Lanyon, a markdown web server

I’ve just released a new bit of software I’ve been developing. Lanyon is a simple web server, which reads directories of markdown files and converts them to HTML and serves. An intuitive and easy way to create a website. It is open source and available on Github at github.com/mkaz/lanyon Lanyon was derived from my static […]

The Command-Line Office

Live your life on the command-line, this week we take a look at a suite of command-line office tools and utilities. Updated: This article received a little bit of extra attention and comments which brought some great suggestions and alternatives. I’ve tested a few of them out and included additions below, also check out the […]

Preventing Errors in Code

This week looking at preventing errors when coding: An ounce of prevention If you don’t read anything else, read the Joel Test to make sure your development practices follow the basics. If you can’t pass the test there’s your todo list, Joel Spolsky wrote it over a dozen years ago and still just as valid […]

Command-line Basics and Tips

A collection of tips to help you on the command-line using Linux, Mac OS X or other unixy command-line system. You might already know most but hopefully there are a few new ones or helpful tips on how to save time and use in productive ways. I’ve tried to include real and useful examples for […]

Python Data Science

My notes, resources and examples using Python, NumPy, SciPy and Matplotlib as alternatives to R and Matlab for data science and analysis. Load Data from Text File An example loading comma delimited data using Numpy: Plotting and Graphing Log Scale Labels for Titles and Axes Saving a Graph The following will create a png image […]

Python Date Formatting

A set of examples working with Python date and time functions, including formatting dates, date calculations, and other common date tasks. See my string format examples for working with python strings. First off, all examples use the following import, any additional imports needed will be shown with the example. Creating Date Objects Typically the first […]

Python String Format Cookbook

Python v2.7 introduced a new string fomatting method, that is now the default in Python3. I started this string formatting cookbook as a quick reference to help me format numbers and strings. Thanks to other contributors I’ve expanded the examples over time. Python 3.6 introduced, formatted string literals, often referred to as f-strings as another […]

Use Python + Selenium to Automate Web Timing

I’ve been hearing a lot recently about the Navigation Timing spec, which sets a multitude of timing events as javascript properties. There are numerous events in the flow, from the very first navigation event, which could be when the user clicks a search result in Google, to DNS timing to Dom parsing etc. See the […]