Did you know that you can use Google Sheets as a JSON API?

You don’t necessarily need to write server-side code for everything.  Sometime there is a much easier solution.  Did you know that you can use Google Sheets as an API endpoint?  Let’s take a look at a quick example. For a few years now, I have been archiving my tweets as Google Sheets documents.  There is …

Continue reading "Did you know that you can use Google Sheets as a JSON API?"

Playing with the OpenWeather API: The basics

Ever since Apple bought and shut down Dark Sky, I have been struggling to figure out what to replace it with.  I figured that this would be a good excuse to play with some weather APIs.  I have done this once before but that was with Rivets and YQL (neither of which I can necessarily …

Continue reading "Playing with the OpenWeather API: The basics"

Playing with WebRTC: Taking still photos

This is going to be a pretty quick post.  I was playing with an MDN Tutorial on WebRTC and started wondering what I could do with it. Here’s how the basic functionality works: See the Pen JavaScript Photo Booth – Part 1 by Joe Steinbring (@steinbring) on CodePen. So, I was thinking about the post …

Continue reading "Playing with WebRTC: Taking still photos"

Object.seal() vs Object.freeze()

So, you want to protect an object that you created in JavaScript?  With Object.seal() and Object.freeze(), you have two solid options that do slightly different things.  While Object.seal() prevents new properties from being added to the object and marks all existing properties as non-configurable, it still lets you change the values of properties.  Object.freeze() on …

Continue reading "Object.seal() vs Object.freeze()"

Playing with more tabular data

Previously, we looked at ways to display tabular data on a webpage.  Let’s pick up where we left off, but with more data.  The last time, the data was hard-coded into an array.  This time, let’s use Axios to load some fake data from JSONPlaceholder. See the Pen Table Pagination – Example 1 by Joe …

Continue reading "Playing with more tabular data"

Var vs let vs const in JavaScript

The next post in our X vs Y vs Z series is var vs let vs const.  I’ve wanted to cover this for a little while.  Let and const were added to JavaScript with ECMAScript 6.  Var has been around a bit longer. Var is used to declare a function-scoped or globally-scoped variable.  Var declarations …

Continue reading "Var vs let vs const in JavaScript"

Block vs inline vs inline-block

I’m not sure that this concept is universally understood.  I figured that it is time to take a swing at it. According to w3schools, a block-level element always starts on a new line and takes up the full width available (stretches out to the left and right as far as it can). See the Pen …

Continue reading "Block vs inline vs inline-block"

Cookies vs localStorage vs sessionStorage in JavaScript

Back in 2012, I posted How to store JavaScript values persistently, locally (a post that is apparently a bit broken).  I figured that it might be time to revisit the topic. Let’s start by looking at how to create and read cookies, first. See the Pen How to use cookies! by Joe Steinbring (@steinbring) on …

Continue reading "Cookies vs localStorage vs sessionStorage in JavaScript"