Title photo
frugal technology, simple living and guerrilla large-appliance repair
Thu, 30 Mar 2017

React-Redux links by Mark Erikson

React-Redux links by Mark Erikson https://github.com/markerikson/react-redux-links -- an excellent list that also covers learning JavaScript

Learning to code when you’re busy

Learning to code when you’re busy https://medium.com/the-odin-project/learning-to-code-when-youre-really-dang-busy-e223a7f84758

Wed, 29 Mar 2017

Using highlight.js for code syntax highlighting on your web site

I first learned about highlight.js while trying out the Go-based Hugo blogging system, where it is a popular choice for adding syntax highlighting to blocks of code displayed on web pages.

Another solution is Pygments, but I didn't want to wade into Python, and a pure JavaScript solution like highlight.js seemed easier all around.

I had already used highlight.js successfully in a couple of Hugo themes, one in which I did the installation myself and another that had it built-in.

So it was only a small leap to do the same on this Ode site.

The instructions are clear (and easy), and the highlight.js developers allow you to create a custom download via check-boxes to include only the languages and markup you want to use on your site. That same page has info on using two separate CDNs (content delivery networks) to deploy highlight.js on your web site, but I opted to create my custom bundle and host it on this site as part of my main Ode theme.

Once you have the Javascript and CSS on your site and are calling it into your web pages, everything between <pre><code> and </code></pre> will benefit from highlight.js' syntax highlighting.

And as you can see, it works.

The only time this kind of syntax highlighting gets problematic is when displaying HTML, where you need to replace < with &lt;, > with &gt; and so on.

Here's a small bit of Ruby so you can see what the syntax highlighting looks like without leaving this post:

Dir.glob("X16*") do |file|
 File.delete(file)
end

Eloquent JavaScript - Chapter 2 exercises - Fizz Buzz

I'm not saying I will make it through all 22 chapters of "Eloquent JavaScript," by Marijn Haverbeke, but enough people I respect have recommended the book that I'm doing my best to absorb what I can from it.

To that end, I am doing the exercises in the back of each chapter, and I plan on presenting my solutions here.

This entry also serves as a test of the Highlight.js JavaScript library, which I just added to this Ode site for syntax highlighting of code. I'm using the zenburn CSS.

Back to "Eloquent JavaScript." If you don't want any hints, don't go past the blog index. I will only start showing my code after the "read more" portion of each entry.

Before maybe a year ago, I'd never heard of Fizz Buzz, where you write a program that outputs the words Fizz, Buzz or Fizz Buzz depending on whether a number is divisible by 3, by 5 (and not 3) or by 5 and 3.

Fizz Buzz is supposedly used as a programming test in hiring. I was surprised when it was given as the second exercise in Chapter 2

Read the rest of this post

Thu, 23 Mar 2017

Coming over to the dark side

I recently received a too-expensive birthday present: a new laptop.

For the women in my life, seeing all those keys pop off was too much I guess.

The HP Pavilion g6-2210us is still kicking as it nears the 4-year mark. That's a modern record for me. My previous laptop, the Lenovo G555, died just after its second year of service. I still have a second replacement keyboard still on the way from China for the HP Pavilion.

Once I get this new laptop fully set up, at some point I'll pop a new hard drive into the old HP. The current drive has a lot of bad sectors. A lot. Then I'll run it as a full Linux system with no Windows partition.

So what about the new laptop?

It's an HP Envy 15-as133cl 15t with Intel Core i7, 1080p resolution, 16GB of RAM and a 1TB spinning hard drive.

The case is all metal, which is quite an upgrade from my previous all-plastic laptops.

It has Windows 10. The first thing I did was install the Windows Subsystem for Linux so I could have Bash in the terminal and access to thousands of console-based applications from the Ubuntu archive.

Read the rest of this post

Sun, 12 Mar 2017

Read all of Manton.org

Read all of http://manton.org. Deep thoughts on the social and personal web.

Mon, 06 Mar 2017

I install a Netgear AC750 WiFi Range Extender

I install a Netgear AC750 WiFi Range Extender http://stevenrosenberg.net/hugo/post/2017_0304_wifi_range_extender

Wed, 01 Mar 2017

Whiteboard interviews ensure biased hiring in tech, and programmers are calling them out

Whiteboard interviews ensure biased hiring in tech, and programmers are calling them out https://theoutline.com/post/1166/programmers-are-confessing-their-coding-sins-to-protest-a-broken-job-interview-process