Posts

Know your options - 1 minute read

I just read a post from another developer about front-end frameworks and whether or not they're worth the trouble.  The conclusion: they're worth the trouble sometimes.  The best solution is to know your options and use them when appropriate.

There’s a solution for that! It's called, 'lots of time.' – 2 minute read

Image
One of the best investments that I made this year is a subscription to www.safaribooksonline.com ,   an online  l ibrary for technical books.    I’m working my way through the videos for Querying Data with Transact-SQL - Exam 70-761 Certification Training by Mark Long.   I got a good laugh from one of his comments: while talking about how important it is for database developers to have a good knowledge of the data that they’re working with, he said, “There’s is a solution for that!   It’s called ‘lots of time.’    After you spend lots of time with your data set, you get to know it better and better and become more proficient.” Well, I recently had a slightly different problem:   I wanted to install Node.js 8.9.1 (the current LTS version) on my Ubuntu laptop.    Since most of my OS knowledge is on Windows, I simply wasn’t able to get it to work. Then I remembered Mark’s wisdom: “There’s is a solution for that!   It’s...

More time coding. Less switching windows. - 1 minute read

Gulp has come through for me.  Here's a gulpfile that will save you some time toggling back and forth between your IDE and the command line: const gulp = require ( 'gulp' ); const cp = require ( 'child_process' ); gulp . task ( 'runTestsOnChange' , function runTestsOnChange () { gulp . watch ([ '**/*.js' ], function () { console . log ( 'change detected' ); try { cp . execSync ( 'jasmine' ,{ //set current directory to the child process' current working directory cwd: __dirname , //the child process will use the parent's stdin, stdout and stderr streams stdio: [ 0 , 1 , 2 ]}); } catch ( error ) { console . log ( 'Looks like your tests did not pass. No worries. Keep working!' ); } }); // gulp.watch(['**/*.js'], ['jasmine']); }); gulp . task ( 'default' ,[ 'runTestsOnChange' ...

Computers should do what people want them to do - 1 minute read

Sometimes I spend time (perhaps too much time) tweaking my computer.  I do this because computers should do what people want them to do.   Customization and personalization are important when it comes to the tools that we use every day. I have an Automator script that delays the startup of some applications that I commonly open.  Slack is one of these applications. I am frequently using my computer after-hours (tweaking code and researching), and I found that I got annoyed when Slack opens at those times because 1) I  don’t usually want to the interrupted at those times and 2) Slack is a leviathan application that takes an excessive amount of time to load.  So I wrote my first AppleScript to fix that problem.  I chose AppleScript because dealing with dates in bash is more difficult than it needs to be and Automator can run AppleScripts. Here it is: enjoy! --based on https://stackoverflow.com/questions/25334780/how-to-start-an-applescri...

Serendipity - 1 minute read

Image
I'm always looking to get lucky.  My latest project is a website that that finds healthy food near people.   https://github.com/tmurphree/healthy-near-me   I thought I would     have to do a mash up of the Google Places API and the Nutririonix API (which has nutrition information), but apparently this is such a common use case that Nutririonix has a beta API end point for this. https://www.nutritionix.com/restaurant-map?c=38.8983:-77.0273:15   I guess the question is now, is the project worth doing? I think so. The whole point of the exercise is to deliver value to the end user. If that happens, then it’s worth doing.  Plus, depending on the quality of the endpoint, it may need augmenting anyway.  I'll post my progress as things develop!

Automatically running tests on your back-end Node.js code - 1 minute read

--deprecated: this only works intermittently-- Building something for the front-end and want to run tests on your code automatically?  Use Karma ( http://karma-runner.github.io/1.0/intro/configuration.html ).  It'll run tests in web browsers when you save your .js files. But what if you're building for the back end and don't want to run the tests in browsers?  I'm assuming that you already have nodemon installed and don't want to muddle up your Grunt / Gulp / other automation modules. Use nodemon. The general syntax is:    nodemon --watch <folder> --exec <command> For example:    nodemon --watch js/ --exec ./node_modules/.bin/jasmine

"Never miss a good chance to shut up" - 1 minute read

Image
I'm reading Duty  by Robert Gates, former Secretary of Defense under George W. Bush and Barack Obama, and it's an interesting read.  One of the more memorable quotes so far in the book is that, while regretting some comments that he made to the press, Gates moans that he forgot one of the more important rules in life: "Never miss a good chance to shut up." Although probably more applicable to Secretary of Defense than to you and me, it's still good advice for you and me. The book has left me with more patience for elected officials.  The number of complex issues that they have to deal with -- simultaneously -- it truly staggering.