Gyro 0.3

Gyro grows some legs

It was just a few days ago that I started an experimental wiki project called Gyro ... it's always fun when a project just grows features organically. It does this, so it makes sense to make it do that, and then this other thing is easy, and so on.

So, here is what happened with Gyro:

  • Federico Cingolani made it run on docker
  • I added some features:
    • UI for creating new pages
    • UI for deleting pages
    • Support for multilevel pages (so you can have "foo" and "foo/bar")
    • Autocompletion with titles in search
    • Breadcrumbs so you can actually follow the multilevel pages
    • Lots of code cleanup
    • Themes (via Bootswatch)
    • Custom fonts (via Google WebFonts)
    • Automatic linking for WikiWords if you like that kind of thing

And, I published it as a Google Chrome Extension ... so you can now have a wiki on your chrome. If you saw how it worked before, you may wonder how it became an extension, since those are pure Javascript. Well... I made it have pluggable backends, so it can either use the older Sanic-based python API or use LocalStorage and just save things inside your browser.

The behavior is identical in both cases, it's just a matter of where things are saved, and how they are retrieved. The goal is that you should not be able to tell apart one implementation from the other, but of course YMMV.

And since I was already doing a chrome extension ... how hard would it be to run it as an electron "desktop" app? Well, not very. In fact, there are no code changes at all. It's just a matter of packaging.

And then how about releasing it as a snap for Ubuntu? Well, easy too, just try snap install gyro --beta

All the Gyros

Is it finished? Of course not! A non exhaustive list of missing MVP features include:

  • Import / Export data
  • A syncing backend
  • General UI polish (widget focus, kbd shortcuts)
  • Better error handling
  • General testing

But in any case, it's nice to see an app take shape this fast and this painlessly.

New mini-project: Gyro

History

Facubatista: ralsina, yo, vos, cerveza, un local-wiki-server-hecho-en-un-solo-.py-con-interfaz-web en tres horas, pensalo

Facubatista: ralsina, you, me, beer, a local-wiki-server-done-in-one-.py-with-web-interface in three hours, think about it

/images/gyro-1.thumbnail.png

The next day.

So, I could not get together with Facu, but I did sort of write it, and it's Gyro. [1]

Technical Details

Gyro has two parts: a very simple backend, implemented using Sanic [2] which does a few things:

  • Serve static files out of _static/
  • Serve templated markdown out of pages/
  • Save markdown to pages/
  • Keep an index of file contents updated in _static/index.js

The other part is a webpage, implemnted using Bootstrap [3] and JQuery [4]. That page can:

  • Show markdown, using Showdown [5]
  • Edit markdown, using SimpleMDE [6]
  • Search in your pages using Lunr [7]

And that's it. Open the site on any URL that doesn't start with _static and contains only letters and numbers:

  • http://localhost:8000/MyPage : GOOD
  • http://localhost:8000/MyDir/MyPage: BAD
  • http://localhost:8000/__foobar__: BAD

At first the page will be sort of empty, but if you edit it and save it, it won't be empty anymore. You can link to other pages (even ones you have not created) using the standard markdown syntax: [go to FooBar](FooBar)

There is really not much else to say about it, if you try it and find bugs, file an issue and as usual patches are welcome.


[1] Why Gyro? Gyros are delicious fast food. Wiki means quick. Also, I like Gyros. to check it out. So, since this was a toy project, why not?
[2] Why Sanic? Ever since Alejandro Lozanoff mentioned a flask-like framework done with the intention to be fast and async I wanted
[3] Why bootstrap? I know more or less what it does, and the resulting page is not totally horrible.
[4] Why JQuery? It's easy, small and I sort of know how it works.
[5] Why Showdown? It's sort of the standard to show markdown on the web.
[6] Why SimpleMDE? It looks and works awesome!
[7] Why Lunr? It works and is smaller than Tipue which is the only other similar thing I know.

La Importancia de los Dedos en el Pensamiento Informático

Pensar con cosas que no sean el cerebro es descalificatorio: vos pensás con el culo, vos pensás con el pene. Es una variante de hacer cualquier cosa con la parte incorrecta del cuerpo, porque yo escribo con los codos, ella programa con las patas, etc. Tal vez por eso me siento incómodo cuando empiezo un proyecto nuevo, porque siento una picazón indecente de empezar a pegarle a las teclas con las yemas, como si las ideas de como implementar cosas no salieran de mi cabeza, como si brotaran de mis dedos, como si fluyeran por mis brazos, como Palpatine electrocutando a Darth Vader, con esa prepotencia Arltiana de no poder conversar sino tipear en orgullosa soledad programas que encierren la violencia de un cross a la mandíbula, y "que los eunucos bufen".

Y no, no es la manera ideal de hacer las cosas, sospecho, en el mismo sentido que chapar en la primera cita o tocar ese culo consentido en el primer lento de Air Supply fueron decisiones que parecieron buenas en el momento pero muchos hemos vivido para lamentar, pensar demasiado con los dedos produce código de mierda, como era de mierda el noviazgo que empezó en aquel asalto, pero es realmente código de mierda si es código que existe comparado con el teórico noviazgo con la chica que no quiso bailar con uno? No, es código copado, es código gauchito, es código con savoir faire.

Pensar demasiado es someterse al waterfall interior, que es el peor waterfall, y sí, a veces he pensado un programa muy lentamente durante cinco años, dejándolo madurar en mi interior como una Tahina spectabilis que florece cada cien años, pero recuerden que la flor que produce huele como un cadáver y la planta muere inmediatamente. Los proyectos maduros son proyectos pudriéndose, es un equilibrio fino que no cualquiera puede caminar, no somos todos Philippe Petit, no sabemos cruzar de una torre a la otra sobre una soga, nos caemos como King Kong, trepados a una torre que no entendemos pensando en Jessica Lange.

La programación no es prog rock, no es Lark Tongues in Aspic, programar es, el 90% del tiempo, los mismos cuatro acordes de Sheena is a Punk Rocker, cambiados de lugar, más rápido o más lento, mientras hacés temas de dos minutos porque tu papá no te quiso cuando eras chico, es recordar que el primero se tira, como el mate, que el primero te lo regalan el segundo te lo venden, que por eso el primero lo regalás, el segundo lo hacés bonito y lo regalás también, que carajo.

Y mientras tanto, escuchen "Como salvajes" de Attaque 77, que dura tres minutos, te da ganas de salir a patear bolsas de basura por la calle, y es un cuento de scifi medianamente decente, no perfecto, pero mucho mejor que el que no escribiste.

Changes in this blog

I have made a few changes in how this blog is generated and what features are enabled.

Similarity Plugin

I have enabled the similarity plugin and disabled the equivalent feature provided by Disqus. In general, it seems this plugin produces more whimsical connections which is a big plus. It may lead you to discover very random things I wrote. I know it reminded me of things I did not remember writing!

Continuous Import

I have enabled the continuous import plugin which will automatically merge some other aspects of my online presence with this blog. Currently it has support for goodreads (which I already mentioned before) and youtube (which I have not), so you will see short book reviews and random videos I make.

Examples: goodreads and youtube

This plugin can theoretically support anything that provides a RSS/Atom feed and lets you apply custom templates to the content so you end up with pretty posts in all cases. If you are interested in using it for some other service, feel free to ask me about it.

Front Page

For the first time ever, the front page of this site is no longer the blog, but a landing page.

Theme

At some point in the future I may switch to a more customized theme, but that's not in any specific roadmap, it will happen when it happens. In the meantime, this is now using the Lumen bootswatch and am experimenting with using FlowType for a more readable automatic font size.

I am now using almost an IDE

I have long been a proponent of simple text editors.

Not for me was emacs, with its multitude of modes and magical elisp code to do everything.

Not even vim with its multitude of extensions achieving magical productivity with three keystrokes.

Not even would I use the ubiquitous jetbrains IDE with magic refactoring that writes code on its own.

No, for twenty years or so I have written my code using a plain text editor. Until recently, that meant kwrite. Not even kate. Kwrite, the one that is slightly more powerful than notepad.

But then I got a new job, and everyone uses an IDE so I started thinking... I must be missing something.

Because if everyone is doing it differently from you, then one of the following things is likely to be true:

  • everyone is wrong
  • it's purely an opinion thing and it doesn't matter much
  • you are missing out

You know you are old once you assume the first. Since I am going through some sort of weird mid life crisis I am forcing myself to choose the last option most of the time. So, I started trying out stuff. Which is why I no longer use bash. Or unity. Or KDE. But those are stories for some other bonfire, this one is about my text editor midlife crisis.

Atom

It's huge. And slow. Like, really slow. And the extension quality is very uneven. For example, all the terminals felt wrong.

Once it started dragging after being open for a couple of days... well, I removed it and smugly went back to my old workflow.

And then I tried...

Pycharm

The extension quality was soooo much better! And some are just awesome. The way you can choose a virtualenv interpreter for a project is awesome.

Compared to Atom it's downright snappy!

The only things I did not like were:

  • So much magic in place, sometimes things only worked in the IDE.
  • Too slow to start, so I still had to use a plain text editor for casual edits.
  • At one point, things started to rot, and functions that had been working fine started to misbehave.

So then I had my goldielocks moment...

VSCode

I was expecting to hate it. It's called Visual Studio! It comes from Microsoft! It's electron-based like Atom!

Yet, I loved it at first sight.

Not going to go over many details because I am not in the business of convincing people of things but here are some of the highlights:

  • Good python support, including virtualenvs, formatting, autocomplete, refactoring, debugger, etc.
  • Good Go support.
  • Nice terminal gadget! Ctrl+click to open files mentioned in the terminal!
  • Good markdown/reSt support including previews
  • The "compared to working tree" view is genious
  • If you run "vscode somefile" in the terminal, it opens in the current vscode.
  • The settings mechanism and UX are a great idea.
  • It's fast enough
  • The UI is fairly minimal, so most of the time it will look like my previous workflow used to look: two text files open side by side.
  • Test runner integration is neat.
  • In Ubuntu you can install it as snap install vscode --classic ... takes all of 30 seconds. And it's updated forever.
  • Lots and lots and lots of decent quality extensions.

So, all in all it does all the things I liked from the IDE side of the universe while not making the things I liked from text editors less convenient. And that's why I use it now.

Cumulus

  • Author: Eliot Peper
  • Rating:
  • See in goodreads
  • Review:

    So, Alphabet owns Uber and they are actually Waymos. And Alphabet is owned by this daughter of chinese immigrants that likes basketball, and Steph Curry is a druglord. More or less that's the idea. Not really my cup of tea, but not horrible by any means.

Books on this site

I read a lot, they tell me. And I do keep somewhat sloppy records of what I read in goodreads.com ... I even sometimes write short reviews of those books I read! But until now that content was "over there" instead of being "over here".

Sure, I could copy/paste everything one way or the other and keep them in sync. But what sort of no-good nerd would I be if I created a repetitive task for myself? Answer: a very no-good one.

So, I am automating it, and just because why not, I am turning it into a generic "merge any random feed into your Nikola site, even if it needs tweaking and the metadata you want is hidden in random fields and then you need to reformat the output so it looks sorta nice" via a Nikola plugin.

That plugin is very much a WIP but as you can see in the goodreads tag it does work somewhat, and it will get better over time.

You can see that plugin here: https://plugins.getnikola.com/v7/continuous_import