David Herron's blog

A very chilling Executive Action on Donald Trump's first day in office

A crazy thing has happened to the U.S., reality TV star Donald J Trump has been elected President. He brought within him into power a litany of people who are hell-bent on Conservative causes - pretty much all the Cabinet Secretary's are people who'd previously promised to destroy the agencies they were appointed to lead, for example.

New Book: Asynchronous JavaScript with Promises, Generators and async/await

es-2015-16-17-promises-generators-and-async-await-2-1000.jpgThe JavaScript language is changing, and among the changes are three new features which will revolutionize the way we wri

Asynchronous array operations in ES7 JavaScript async/await functions

A glaring problem with the most excellent async/await feature in JavaScript is all the existing coding structures that only work with synchronous code. In an async/await function it's trivially easy to write a simple "for" loop that contains whatever async/await calls you want. But as soon as you try "Array.forEach" with an async callback function it will fail miserably. That's because this function, like so many existing interfaces which take a callback function, assumes the callback is synchronous.

Block remote root login via ssh on Ubuntu/etc to keep your server safe

A moment ago I was checking the system logs on my Ubuntu server and found that in auth.log reports that someone was repeatedly trying to SSH login as root. The "root" entry in /etc/passwd is setup so that no password will ever be matched, so perhaps this potential cracker would never get into my server anyway. But the requests are using bandwidth - and what if they were able to figure out a password that would work? Why not just block remote SSH login access to logging in as root in the first place?

Useful reading to understand the Promises, Generators and the async/await feature for Node.js/JavaScript

The long-awaited async/await feature for JavaScript promises to make our lives much easier. Instead of asynchronous JavaScript programming being tricky and error-prone, with async/await our code will look like regular synchronous code we write in other languages, but will accommodate asynchronous code execution while retaining the single-threaded nature of JavaScript.

Putin's Russia gains three friendly heads of state in last week's elections

landscape-1450461032-putin-index.jpgWe're all shocked, astonished, etc, that Donald Trump won the 2016 US Presidential Elections. The prospect of Donald Trump as US President goes completely against the grain, and is not what'd been expected, but at the same time we shouldn't be surprised. It did happen, and we must look for an effective way to deal with this fact, including fighting strongly against all the crazy stuff that we know is coming.

Memory-efficient CSV transformation in Node.js

nodejs-dark.pngThose of us who consume/edit/modify/publish CSV files must from time to time transform a CSV file. Maybe you need to delete columns, rearrange columns, add columns, rename volumes, or compute some values taking one CSV file and producing another. In my case, I have a raw CSV file with no column headers that's organized in a way which makes sense for one team in our company, but we need that same data organized a different way, with different column names and containing selected fields.

The advent of async/await for Node.js - Node.js v7 has now arrived

nodejs-dark.pngWith today's first release of Node.js version 7, we now have async/await as a base feature of the platform. This is a significant milestone that wasn't even mentioned in the commit message. The async/await feature is so important that I'm preparing a short book to discuss JavaScript asynchronous programming patterns, that highly features async/await.

Click here for more Node.js programming advice

Easily have quality Git server on your laptop with Gogs and Docker, and enable auto-push to remote repository

Github doesn't have to be the only game for git servers - while they run an excellent service, you can't install it on your own server, making it little better (in "Freedom" regards) than a closed source proprietary software package. Yes it's expedient to host your repositories on Github, but do we all have to cede this functionality to them? There happen to be several alternatives to github that offer a competent web-based git repository service.

Pages

Subscribe to RSS - David Herron's blog