Microblog

Erasing your current system and installing from scratch?, Here's some things you may want to backup first.
List of vs code extensions
List sublime text extensions
List of browser extensions
Browser bookmarks
Any encrypted ssh keys and your ssh config file
Downloaded fonts
Custom colors picked with gPick:
Chrome JS snippets:
/etc/hosts file:
Ansible vault files:
Files in your virtual machines:
   psql history
   bash history
Customized config files:
   ~/.config/xfce4/terminal
   ~/.gitconfig
   ~/.bashrc
   ~/.inputrc
   ~/.quodlibet/config
   ~/.config/Code/User/settings.json
   Drop down terminal config
Even your ~/.bash_history
2018-7-1
chromehtml
Workflow for a single programmer deploying to a Digital Ocean VPS
one vagrant virtual machine that mirrors production for testing
2016-8-19
vagrantvps
console.log is slow?
A single console.log execution took 0.445 milliseconds
2017-6-11
javascript
Rules I overrode when using eslint
Before I started using semistandard proper.

"jsx-quotes": ["error", "prefer-single"],
"max-len": "off",
"multiline-ternary": "off",
"no-console": "off",
"no-catch-shadow": "off",
"no-else-return": "off",
"no-inline-comments": "off",
"no-sync": "off",

2017-6-11
javascript
CSS-only Toggles
Some nice css only toggles made by mallendeo
Create a favicon with a transparent background
Minify SVGs
Generate color schemes
Create and validate regular expressions
Encode and decode base64 data
Also, the coreutils package from the Debian repositories comes with a base64 conversion tool:

$ base64 ./arrow-up.svg

PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyB2aWV3Qm94PSIwIDAg
NSA1IiBwcmVzZXJ2ZUFzcGVjdFJhdGlvPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcv
MjAwMC9zdmciIHhtbG5zOmJ4PSJodHRwczovL2JveHktc3ZnLmNvbSI+CiAgPHBhdGggZD0iTSAy
LjUgMCBMIDUgNSBMIDAgNSBMIDIuNSAwIFoiIHN0eWxlPSJmaWxsOiByZ2IoODIsIDgyLCA4Mik7
IiBieDpzaGFwZT0idHJpYW5nbGUgMCAwIDUgNSAwLjUgMCAxQGExN2I2NDEyIi8+Cjwvc3ZnPg==

Generate passwords
Generate passwords with pwgen

$ pwgen -s 10

Best explanation of the event loop I've ever seen
2019-3-3
videojavascript
Tried and failed to use webpack in the backend
The idea of deploying a single js file to production is tempting but unfortunately it could not be done.
The main roadblock are compiled packages, it's not possible to automatically bundle binary files together with js code.

It appears that backend packages are not designed to be bundled and a bunch of errors raise if one attempts to do so.
2017-12-1
nodejswebpack
Download free for commercial use icons.
Determine why a package needs to be updated
In one of my system upgrades, one thing that caught my eye was that one of the packages marked for upgrade was libjs-jquery which is the jQuery library. This is popular library used for web development.
So, why does my debian system want to upgrade jQuery?, where is it being used?

Enter apt-get why. This command outputs the chain of dependencies of the package you give it

$ sudo aptitude why libjs-jquery

i task-xfce-desktop Recommends quodlibet
i A quodlibet Depends exfalso (= 3.2.2-1)
i A exfalso Depends libjs-sphinxdoc (>= 1.0)
i A libjs-sphinxdoc Depends libjs-jquery (>= 1.4)

Turns out that quodlibet, my preferred mp3 player, uses packages that somewhere down the line depend on jQuery. As an explanation, this is good enough for me.
Interesting take on down migrations
Do we still need Down migrations? Laravel creator says No.
2019-5-20
databasemigrations
Singular vs plural database names
The number 1 rule regarding this topic is: Be consistent. Lower the amount of WTF's per minute you get by mixing naming conventions

Although there's no right answer and both sides have compelling (and irrelevant) arguments (See: StackOverflow - Table Naming Dilemma: Singular vs. Plural Names)
I think I'm leaning more towards the plural side.

Of course, this only applies to greenfield projects in which you are in charge of making decisions like this.
2019-5-23
databasenaming
Do (service account) users with no home directory increase security?
Yes, but only marginally. I couldn't find anyone recommending it. It wasn't on nixCraft hardening lists.

Besides, it makes your work as a developer harder. For example, PM2 expects the user running the application to have a home dir in which it can put its .pm2 folder. Yes, there is the $PM2_HOME env variable, but I personally couldn't make it work and trying to fix it, is just more trouble than it's worth.
2019-5-24
linuxsecurity
Tool to output git status from all subdirectories at once by fboender

/devops $ mgitstatus

Outputs:

./vm-nodejs: ok
./create-dev-certificate: Uncommitted changes
./roles/ansible-install-redis: ok
./roles/ansible-restore-database: ok
./roles/ansible-install-postgresql: ok
./roles/ansible-sequelize-migrate: ok
./roles/ansible-remount-shared-folder: ok
./roles/ansible-install-nginx: ok
./roles/ansible-sequelize-seed: ok

2019-5-27
linuxbashgittool
Concise explanation of the N+1 query problem
2019-6-7
database
nngroup.com - Mobile Tables: Comparisons and Other Data Tables
Good read on how to design tables for mobile
2019-6-15
web design
Easily set up and code react apps (Also Vue and Angular)
When using the mouseup event
Don't forget that it fires for both left and right buttons of the mouse
2019-9-19
jsdombrowser
Promises vs setTimeout, who executes their callback first?
It's more nuanced, but the TLDR is:

Microtasks execute before tasks.
Promises create microtasks and setTimeout creates tasks.
2019-11-6
jsdombrowser
Flexbox is useful for aligning form controls
Use flexbox if you need make controls the same height in a row or width in a column. Smaller controls will automatically grow to match the height of the container which if set to auto will be the height of the larger control.
2019-11-12
browserflexbox
Replacing standard with eslint + eslint-config-standard
Install dbaeumer.vscode-eslint

npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node


eslint-config-standard: An ESLint Shareable Config for JavaScript Standard Style
eslint-plugin-standard: ESlint Rules for the Standard Linter
eslint-plugin-promise: Enforce best practices for JavaScript promises.
eslint-plugin-import: This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names
eslint-plugin-node: Additional ESLint's rules for Node.js

.eslintrc.json

{
  "extends": ["standard", "plugin:react/recommended", "plugin:import/errors", "plugin:import/warnings"],
  "plugins": ["promise"]
}


Cool rectangle selection box made by Nightly Coding
Working demo of a rectangle selection box, didn't end up using it or any parts of it, but it was reassuring that it could be made with so few lines of code
2019-12-16
browserjs
TLDR: xzoom
Click on xzoom, then drag to the part of the screen that you wish to inspect. That's it!.
However nowadays I prefer Gpick. It will magnify an area just by hovering over it.
2019-12-17
linux
SVG Security
SVGs embedded as images (with the img tag or css background property) won't execute any scripts embedded in them
2019-12-18
browsersvg
ppcp: A command line copy tool with progress info
Made by acidnik: acidnik/ppcp
2019-4-9
copytool
Linux clipboard 101
The linux clipboard is not handled by the kernel. Instead it is a user space program, usually managed by the graphical server

There are 3 clipboards (called selections).

The first one is called PRIMARY and contains the last text that was selected and can be pasted using the mouse middle button.

The second one is called CLIPBOARD (more in line with what Windows users expect) and is used with Ctrl+C and Ctrl+V

The last one is not used

xclip is a tool made for interacting with the clipboard in the command line and allows you to use either of these three selections

Contents in the clipboard have TARGETS, these communicate to the programs pasting the contents what they represent and how they are to be pasted. For example an image needs to treated as a blob
2019-4-9
linuxclipboard
Steps for publishing to NPM
Don't forget to login to NPM and add your keys to the SSH agent.
Push your changes to the master branch, once that is done:

$ npm version patch
$ npm publish --access=public

2019-4-17
gitnpm
Online tool determine cost (size) of NPM Modules
However It won't report size of dependencies or peer dependencies.

bundlephobia.com/
2019-4-25
onlineNPMtool