jueves, 4 de julio de 2019

postgres indexes

I'm progressively more convinced PostgreSQL is my next "emacs", as in "a tool I'm addicted to and I'm determined to find out everything about it".

I'm starting with some of the internals, and some deep descriptions about its various types of indexes.  Those pages provided me a bunch of hours of reading and knowledge on postgres internals.


Also, this week I read somewhere that postgres was first written in Lisp! I guess it shows when you run EXPLAIN on a query. I just confirmed it for a fact. :)

miércoles, 3 de julio de 2019

who's next?

Queues is a pretty fascinating topic.

- https://www.braze.com/perspectives/article/building-braze-job-queues-resiliency
- https://www.youtube.com/watch?v=1bNOO3xxMc0
- http://www.treewhimsy.com/TECPB/Articles/SevenInsights.pdf
- https://www.johndcook.com/blog/2008/10/21/what-happens-when-you-add-a-new-teller/
- https://clojuresync.com/zach-tellman/?__s=syke5mi2pqufm5d27m7f

lunes, 1 de julio de 2019

What's dat?

I still don't know exactly, but it looks very interesting, in a similar spirit as Scuttlebutt:

- https://www.kickscondor.com/on-dat/
- https://github.com/datprotocol/how-dat-works
- https://dat.foundation/
- https://datprotocol.github.io/how-dat-works/

martes, 4 de junio de 2019

TIU: git merge -Xpatience -Xignore-all-space

For better or worse, I'm becoming an expert on git merges.

Today I got to use (TodayIUsed) the special flags: "git merge -Xpatience -Xignore-all-space  mybranch".  And it makes a difference!

Trying imerge again was a bit of a failure due to one of the two branches behaving very bad (lots of churn in the same lines over and over, so it felt like a rebase).

jueves, 30 de mayo de 2019

jq accessing fields with dashes

Let's say you have a json like {"foo": {"bar-baz": true}}.  Dashes in the keys make it impossible to look for jq '.foo.bar-baz'. you  look around and you read that you should use ["bar-baz"].   the thing is that you have to use that syntax everywhere in your query

solving lnav truncate files

lnav is an awesome tool for browsing logs.  I'm not sure what are most of the people doing with logs.... tail -f? grep?  anyway...

Sometimes log files get suddently truncated, and when you're doing development, you don't want lnav to be always refreshing itself with the current contents of the files.

just using a bit of unix magic, we can log our files with "lnav <(tail -F logs/access.log)". 

domingo, 12 de mayo de 2019

ncdu vs dired-du-mode

ncdu a very nice utility that does what you probably want to do when you do 'du -sh *'  repeatedly in different directories.

ncdu allows for navigating through the directory structure seeing sizes and disk usage percentages of files and subdirectories. Also, has vi-friendly keybindings.

Of course, there's a way to do a very similar thing in emacs, which is using `dired-du-mode`. Take a look at the "c-x c-h" keybind to toggle human friendly numbers, and m-x dired-du-count-size to aggregate the sizes of all marked files.