miércoles, 28 de julio de 2021

More on Writing, Notation, Symbols, and Emoji

Since My "On Writing" post, a few posts came through HN that touched somehow on the communication styles, context, and missconceptions on sharing knowledge.

- What happened when I stopped using emojis. That reasonates with my thinking a lot. I'm trying to use only the modern version of '+1' and simple ':)'. The other ones dumb down the expressivity to a baseline that brings nearly 0 info. On the other hand, knowing that old reddit's '/s' has its own family of symbols and meanings made me think that well used, a short symbol can convey the a lot of info (https://toneindicators.carrd.co/). On Context and the power of understanding "where that person is coming from", there's this great example on Greg Wilson's talk What Everoyone in Thech Should Know About Teaching and Learning where it explains how in examining the novice's mistakes, you can infer what he/she didn't understand, and what's the best explanation or example to give in order to solve the enigma and make it 'click'. (As an aside: I think it's a great example of why human interactivity is not redundant once you have docs and wikis.)

Which brings us to APL (again), and its notation. I've been more and more excited by APL, and I'm following now some APLers on youtube, for example Rodrigo Girao which does great short beginner videos on APL solving leetcode problems. Also, subscribed to the shakti mailing list, and reading 'mastering dyalog' when I have some time.

 

On the strict writing side, I found a couple of courses and docs in https://developers.google.com/tech-writing and https://developers.google.com/style/highlights that deserve a good read. I just skimmed them, but well.... something >> nothing.

sábado, 24 de julio de 2021

Cypress, React and Emacs backup/lock files

 So I'm dealing with some javascript lately, and it took me a while to figure out that some of the javascript tooling ("cypress open", or "yarn start" a react app) fails to refresh correctly (in fact exits with an exception) every time you modify a file that it is watching.


So, if autorefresh is "on", you can't touch any file.  Not good.

Found out that the cause of those failures are both emacs lockfiles and backup files. They are created in the source directories, and then, js tries to load them, or to examine them somehow, and js falls flat on its face.

(setq make-backup-files nil  

         create-lockfiles nil)  

That should do it.



domingo, 11 de julio de 2021

Deploy and SPA and getting 404 errors? WTFs that become normal

So, deploying an SPA to an S3 bucket, or github pages involves hacking your way around 404's.  

I did not know this one previously, but once you understand what happens under the hood, it makes sense, the web file server can't understand about any kind of paths besides index.html.  What feels strange is that the "official" ways of deploying such "modern" apps feels like it's using a hack, relying on this catch-all solution of overwriting the 404 page to serve index.html (and potentially hacking it's router), or create an ad-hoc 404.html page and put the hack there.  

Finding all info in random blogposts, stackoverflow threads, gists.... The whole thing seems so fishy... but I've come assume that it's just the way it is. That's the full story. Accept it and move on to more interesting things (like fighting CORS or Same-Site Cookies on buggy browsers)

  • https://github.com/rafgraph/spa-github-pages
  • https://medium.com/swlh/how-to-host-your-angular-reactjs-vuejs-spa-on-github-pages-2d9ab102ac7b
  • https://dev.to/alexeyromanchenko/how-to-deploy-spa-as-a-static-website-using-aws-s3-1adg
  • https://gist.github.com/bradwestfall/b5b0e450015dbc9b4e56e5f398df48ff
  • https://johnlouros.com/blog/using-CloudFront-to-serve-an-SPA-from-S3



sábado, 10 de julio de 2021

viernes, 9 de julio de 2021

Show other revisions of a file with magit

Magit proper offers magit-find-file and magit-find-file-other-window, that ask you for both revision and file. At least they autocomplete with sane defaults. 

The thing is my usecase is 99% "current-file in previous-branch in a split window".

As easy as

(defun rgc/magit-find-file-dwim ()
  (interactive)
  (magit-find-file-other-window (magit-get-previous-branch) (buffer-file-name)))

You get a nice command to open the current file from the previous branch you visited in your repo. 

Often, next immediate  command is m-x ediff-buffers RET. (yeah, maybe adding that would make it even more dwim).

If you'd want to do it in the command line, something like 

    git show branch:file

Would do, but you'd have to type both branch and filename.

 

domingo, 4 de julio de 2021

Taming Zoom with Ratpoison, part 2

 It's been already 2 years since the last zoom hack, and it worked fine for some time, but since January 2021, Zoom was behaving even worse on my ratpoison setup. Hijacks of popup windows left me without being able to join zoom with any sort of confidence.

A temporary solution is to use ratpoison's tmpwm, but there's another wrinkle there. In the latest official ratpoison release (1.4.9, from 2017), there's a bug that makes ratpoison not be able to go back from a tmpwm if you have multiple screens. It is fixed in the git version, but having to compile your own WM is yet another yak to shave. (Even more when using nixos). 

So I spoke to a coworker who's a StumpWM user and asked if stump had those issues.

So, it turns his hack worked, and it consists of changing the .config/zoomus.conf. Changing config files on proprietary applications reminds me of my reverse-engineer times on Windows 98.


Anyway:

sed -i 's/enableMiniWindow=true/enableMiniWindow=false/' ~/.config/zoomus.conf


Thanks, Tim and good luck!

sábado, 3 de julio de 2021

Anomalies and Resilience in software

A great read of a mars story and great lessons on software design, systems thinking, and probably resilient software.

https://mars.nasa.gov/technology/helicopter/status/305/surviving-an-in-flight-anomaly-what-happened-on-ingenuitys-sixth-flight/

 

 

If you want to really go into detail in the greatest space story ever, dont' miss this one from the Moon landing: https://www.youtube.com/watch?v=B1J2RMorJXM