This just made my day =)
Source: For the Love of Code
This just made my day =)
Source: For the Love of Code
It’s alarmingly simple – a 52 x 90 grid, which represents your life, assuming you life to be 90. Each square is a week.
I found it a bit of a gut punch to see my weeks splayed out like that. The phrase “it really puts things in perspective” is an overused cliché, but this does just that. You literally see your life from another perspective. And in some ways, it is horrifying. I’m a third of the way down the page, and what have I achieved, really? How long have I left? And this is the best case scenario, really, barring miracle life extension technologies. How much can I cram into those remaining boxes? Each one seems ridiculously precious.
Anyway, it’s an interesting project. The weeks can be toggled, but there’s no functionality there so I don’t know what the point is. Perhaps the author is working on some extra features. It would be cool, and scary, to be able to put in your birthday and see where you are on the grid.
I’ve released a new app on the windows store, a universal / UWP app for counting words. It sounds silly, but I needed a way to count words on my phone, and there were no options.
At time of writing there are three other wordcount apps on the windows store. One is full of horrific full page ads, one doesn’t work (on wp10 at least), and one is a paid app.
It seemed to me that there was a gap in the market there for something that worked, didn’t cost anything and didn’t try to sell you some random crap. It takes some balls to charge someone for an app that counts words. As for the ads guy, don’t get me started.
Here’s a link to wordcount in the store, which is free, has no ads, no in-app purchases, and works on windows 10 and windows phone 10.
Josh Branchaud wrote a small file detailing some bit of programming knowledge he learned every day for 328 days. I really like this idea and I think I might just do it. I certainly won’t be posting as often as he is – I don’t learn quickly enough – but it’d be nice to be able to look back on everything I’ve learned in one year.
So what did I learn today?
Electron has two processes – a main and a renderer. Both have access to node.js but almost all of your code should sit in the renderer. This is not what I expected. I assumed my code would go in main.js, but apparently this is really only for very low level stuff like manipulating the window and menu. Even database / file access code belongs in the renderer!
Differences Between Main Process and Renderer Process
The main process creates web pages by creating
BrowserWindowinstance runs the web page in its own renderer process. When a
BrowserWindowinstance is destroyed, the corresponding renderer process is also terminated.
The main process manages all web pages and their corresponding renderer processes. Each renderer process is isolated and only cares about the web page running in it.
In web pages, calling native GUI related APIs is not allowed because managing native GUI resources in web pages is very dangerous and it is easy to leak resources. If you want to perform GUI operations in a web page, the renderer process of the web page must communicate with the main process to request that the main process perform those operations.
Note: If I do start a series of TIL’s I’ll probably follow Josh’s example and stick it on github or somewhere. I’ll keep it out of the blog.
Decided to see if I could find a way to post to wordpress from the command line today. Promptly found wp-cli, which seemed to be the business. Promptly spent an hour trying to get it to install on Windows 10. I had to install php & composer first, only to find that method did not work. Then I had to download a .phar file and write a batch to install it. I also had to go fiddling with system path variables.
Would it be quicker if I knew what I was doing? Sure.
Would it take less than 2 minutes if I used Linux/OSX? Probably.
But neither of those conditions held true. I’m not au-fait with composer (though I should be I’m sure) and I don’t run Linux because I develop I use Visual Studio for work. More than that, all the many times I’ve tried various flavours of Linux over the years, they just haven’t floated my boat. They always feel unfinished.
Maybe soon I’ll try again, and maybe I’ll like it, but that’s for another post.
So I finally got wp-cli installed, and wasted about another 30 minutes trying to connect to wordpress. It seems that it wants me to install WP to a root folder, and then it can do command line stuff to that install. So basically, I have to run it on the server on which I have WP installed.
And I’m out.
Aside from taking hours to get up and running, and finding it doesn’t do what I want, the complexity is crazy, for a simple command line tool. The wp-cli folder installed has a brain numbing 2,635 files, and clocks in at 10mb. WordPress itself isn’t that complex, with just over 1,500 files and taking 50mb of my SSD. How can the simple command line tool to post to wordpress need 1,000 more files than wordpress itself? Granted this is a cloned git project, so a lot of that is probably not strictly necessary to the compiled app, but still it boggles the mind.
I abandoned wp-cli, and found a node.js library called “wordpress” which is ‘only’ 500 files (though these are hidden away in my node_modules folder). I can write a single node script that will do most of what I need to my remote wordpress install. If I’d only done this to begin with, those 90+ minutes would have been better spent.
Things I have learned about Databases under WinJS on Windows Phone (as of 2016-01-28)
A wild blog appears.