Posts

Showing posts from September, 2017

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.