So, I saw the PDF John posted discussing JSON format ideas. Ian and
Jon, you rock. It is a great document and excellent ideas. Most of it
makes good sense to me and, I'm sure that, as I reread and understand
better, I will love even more.
That said, there is one fundamental detail I do not love:
authors: {
'#contains': 'author',
'#items': [{ '#value': 'John Smith' }, { '#value': 'Dave Jones' }]
}
First
reason is that the label 'authors' is plural but contains only one
thing. In my opinion, things named plural should always be arrays.
Second is that I envision a line of code like:
const firstAuthor = inData.authors["#item"][0]["#value"];
Looks a lot like C# to me, low signal to noise ratio.
In
my other Javascript life, we would be inclined to use inflection, i.e.,
the assumption that 'authors' has elements with an implied name of
'author' and vice versa. I can understand that our XML roots make this
difficult to accept.
Consequently, I am inclined toward the everything is an object (if it's not a list) approach. EG,
authors: [
{ author: 'John Smith', '@type': 'bigshot' },
{ author: 'Dave Jones', '@type': 'contributor' }
]
This
provides a data structure that mentions the word 'author' the same
number of times as does the XML. That it also provides room for
attributes is good. This seems nicer to me:
const firstAuthor = inData.authors[0].author;
I
don't know if this can be expressed properly with openAPI or if it
violates some other rule of interaction with XML. I do know that, as a
Javascript programmer, I would rather use the form I suggest.
Trump's FCC is about to permanently turn the internet over to the corporations. In a few years, your ISP will be like a cable provider. You can only access the sites that make them money. Other sites will be very slow or non-existent. You will pay for packages. Package A: YouTube, Netflix. Package B: Netflix and Hulu. You want to start an internet business, you will have to work a deal with every ISP corporation. It will be bad.
Go to GoFccYourself.com to be forwarded to the correct page for your comment. Do it every day.
When you click on GoFccYourself.com, you will end up at a page that looks like this:
Click on the 'Express' link. It will take you to the entry form.
Suggested text:
Net neutrality is essential for freedom. Net neutrality requires Title II regulation of internet service providers. ISPs should completely prevented from influencing the cost or performance of the internet resources and websites I want to use. My bandwidth purchase from my ISP and the site's bandwidth purchase from their ISP should be the only charges.
Google as I might, nobody would tell me that the adapter had firmware that could be out of date. Eventually, I found a reference to the idea in the form of an updater that would not work.
The important thing is that I realized that if you cannot use your Macbook for presentations on a VGA projector or display, it might be that you simply need to buy a new one.
I did and now it works.
defaults write com.apple.dock persistent-apps -array-add '{"tile-type"="spacer-tile";}’;killall Dock;
I added some to separate my email and web browser from my development tools and those from the rest of the stuff.
You have to have NodeJS. If you don't have it, google it and make it happen.
Then you need to install prettier. It's NPM page is here.
To install it, type...
npm install prettier -g
This will install it in a command line utility.
In some file (I do a lot of this, so I created a Scripts folder and called the file, ~/Scripts/bin/js/runPrettier.js, you can do what works for you just remember that the bash file below has to point to the file), insert this:
#!/usr/local/bin/node
const prettier=require('prettier');
var inString='';
var writeStuff = function() {
var outString='';
outString=inString;
outString=outString.replace(/^[\s]$/gm, "/*linebreak*/"); //I like to retain linebreaks
outString=prettier.format(outString)
outString=outString.replace(/\/\*linebreak\*\//gm, ""); //you can remove these if you don't
process.stdout.write(outString);
};
//the rest ========================================================
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function(data){
inString+=data;
});
process.stdin.on('end', writeStuff);
Then in a file in the bbedit directory (~/Library/Application Support/BBEdit/Text Filters)
Create a file (I called this 'runPrettier') containing this...#!/bin/bash
~/Scripts/bin/js/runPrettier.js
In the terminal make the bash script executable...
chmod +x ~/Library/Application Support/BBEdit/Text Filters/runPrettier
and, voila!, you have an operating formatter for Javascript.
I assigned mine to a command key so I can always make it pretty.
I don't understand why it fails even when the server name matches something. However, if you have two separate servers with:
server_name xxx.com
server_name yyy.com
You would expect that (assuming that the configs appear in this order) that http://yyy.com would match that server_name. It will not. It will match xxx.com. Why? Because when there is not default, it simply uses the first server. Period.
If you have a default, though...
server_name xxx.com
server_name yyy.com
default_server
It works. yyy.com will match xxx.com.
I come upon this problem because I had a configuration that had the default file that comes in the distribution and it worked.
Then I added SSL. It did not work. Having long forgotten the issue with default, I debugged like a madman. Then I thought about the default issue (I ran into it sometime in the dark past - it is buried in the docs) and saw, There's a default right there!!!
Eventually (I know. This is the least entertaining punchline in history.), I realized that there was no default for port 443. QED
# Default server configuration
#
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
server {
listen 443 ssl default_server;
listen [::]:443 ssl default_server;
ssl on;
ssl_certificate /etc/ssl/PATH/TO/CERT.cer;
ssl_certificate_key /etc/ssl/PATH/TO/CERT.key;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
location / {
try_files $uri $uri/ =404;
}
}
Turns out that bbedit uses the standard system terminal. Someday I will figure out how to subvert that because I cannot imagine any reason that I would ever want to use Apple's dumb old terminal program when iTerm2 exists. In the meantime, I asked the lovely people at Bare Bones Software how to change bbedit's behavior.
Turns out it's right there in the Expert Preferences list (about a hundred obscure things that I never thought of as I searched the Preference preferences for some way to control this). To make it easier for future generations, I offer the complete command line:
defaults write com.barebones.bbedit TerminalBundleID -string "com.googlecode.iterm2"
It works and make bbedit another fraction better.
In one of the goofiest decisions in the node world, the project monitor, nodemon, does not look inside node_modules to figure out whether to restart a project when files are changed. This is certainly because it has to monitor a zillion files if it does and the guy worries about performance.
The problem is that my projects are comprised of node modules and they are put in node_modules. If there is a better place to put them, I beg you, write some comments and save me and the rest of the misery.
So, if you
cannot get nodemon to restart your project or
nodemon won't detect changed files
nodemon will not watch node_modules
(put search phrases in the comments, please)
you can remedy the situation by adding an ignoreRoot key to you nodemon.json file
{ "ignoreRoot": [".git", ".jpg", ".whatever"] }
This overrides the default ignore behavior entirely. Choosing to not list node_modules means they can now be watched.
This is, in fact, explained on the github site (here) but, you have to read a lot of stuff to get to it and it doesn't get found by google.
Perhaps this will change that.
Among the worst things that Apple ever did was make it so that scroll bars are only visible when you want to use them. Often it's hard to figure out how to activate them or they go away before I'm done using them.
Of course, Apple is actually awesome and, after all these years, I just realized that they provide make them show all the time. In the two days since I discovered this, I am happy again for the first time.
To accomplish this minor miracle...
System Preferences -> General -> Show Scroll Bars -> Always
It's like being able to breathe again.
As long as this
var obj={a:'a', b:'b'};
var a = obj
[a].forEach(()=>{})
produces an error, semi-colons are mandatory and any suggestion to the contrary is childish perversity.