Unit Testing Javascript with Jasmine

Jasmine is a framework for unit testing Javascript code. It has an easy syntax that allows fast creation of human readable, spec-like test code to verify the correct behavior of Java application code. When creating a new npm project that will use jasmine for testing, specify “jasmine” as the test script: $ npm init ...

Using Bookmarklets for Simple Browser Tasks

Bookmarklets provide a way to add small customized tools to your browser. They look like regular bookmarks, but instead of having a “http:” address to a page on the web, they contain Javascript code that runs whenever the bookmarklet is clicked. Here’s the obligatory “Hello World” demonstration of a bookmarklet: create a new bookmark in

Exploratory Programming with jQuery

jQuery is a widely used framework for inspecting and manipulating the DOM in modern browsers. It’s often one of the fundamental libraries that’s used in major websites, even underlying higher level frameworks like Backbone and AngularJS. But JQuery can also be used as a tool for experimentation, prototyping, and testing ideas and features in developing

Java 9 Gets an Interactive Shell

With the release of Java 9, an interactive shell (otherwise known as a REPL – read, eval, print loop) is now available. Many languages like Python, Ruby, PHP, and MySQL have had interactive shells since their inception. Javascript got a REPL with the introduction of node (although the developer consoles in browsers have offered a

Saving and Restoring JSON Data in Python

I recently had a need to save some data off to be used (and augmented) each time a python script was run. Python offers a very simple-to-use API to save data in JSON format. JSON stands for “Javascript Object Notation”. Originally developed for Javascript, writing and reading JSON is supported now in a wide variety

Developing a Minimum Viable WordPress Plugin

What is the minimum amount of coding required to create a new plugin that shows up in the WordPress dashboard? How much code has to be written to get the plugin to do something minimally interesting? It’s really pretty easy to create a minimal WordPress plugin to experiment with. Simply create a .php file under