After spending a couple years away from C# and node.js programming doing a fair amount of ETL work and a lot of Java, I’m working on getting back into the swing of two of my favorite languages. Yes, I’ll admit it - my controversial take is that I actually like JavaScript a lot of the time. Like most languages, it’s not perfect, but it gets the job done as long as you’re careful (and do some testing) and its flexibility is both a blessing and a curse. Read More...
I’m writing this up as much for my own future reference as I am to help others, since I found the documentation a bit lacking in this area.
For reasons not worth getting into, I needed to build a proof-of-concept to transparently proxy requests to different servers based on a querystring value, using nginx as a reverse proxy.
The TL;DR solution:
worker_processes 2; events { worker_connections 1024; } http { upstream server1 { server web1:8080; } upstream server2 { server web2:8080; } map $arg_queryval $node { default server2; "abcd1234" server1; } server { listen 80; location / { proxy_pass http://$node; } } } This transparently routes any request to the proxy with a querystring argument of queryval=abcd1234 to server 1. Read More...
Getting back to writing articles after spending the better part of a month fighting off a sinus infection and helping my wife get over a nasty cold. Normally I love northeast Ohio, but I’m so over winter right now.
I read a post a month or so ago asking why it’s so difficult for programmers to write code to flatten a list… so naturally, this got me thinking about it and I wanted to tackle it. Read More...
When we left off, we’d gotten our data imported from the CSV, run a map operation on it to add some extra metadata, demonstrated how to use Ramda to filter it, and had a quick demonstration of simple currying. Let’s move on. To recap, this is where we’re starting from:
const fs = require('fs'); const csv = require('fast-csv'); const R = require('ramda'); function getTransactionsFromFile(fname) { return new Promise(async (resolve, reject) => { if (! Read More...
Recently, I’d wanted to sort through a bunch of transaction data from my bank to figure out what our spending trends were in a couple of areas. I suppose I could’ve done this quite effectively with Excel or Apple Numbers, but then I said, hey, that’s boring. :) I’ve been doing a lot of documentation and research stuff at work lately and really wanted to get my hands on a little toy project for a change of pace. Read More...
I’ve been setting up a new OS X installation and wanted to quickly get Visual Studio Code set back up. Atom has a really handy command line utility, apm, that lets you do useful things like export a list of extensions and reinstall them elsewhere by passing in that list as a command line argument.
Unfortunately, while Visual Studio Code’s command line utility allows you to get a list of extensions with code --list-extensions which you can pipe into a text file, it doesn’t appear to have any way to automatically install the extensions to that file. Read More...