martes, 11 de septiembre de 2018

The Algernon Argument

From Here:
That intelligence (g) in healthy people is nearly impossible to improve is clear from the failure of psychology to provide any such method. But why intelligence would be so constant is not as clear: many other cognitive abilities are improvable (like working memory), so why not intelligence?

domingo, 12 de agosto de 2018

Adopting org-gcal.el

I just wanted to announce that I recently adopted org-gcal.

This great emacs mode imports google calendar events to your org files, and has some support for exporting events to your google calendars.

The author went missing in action for more than a year, and there were some nasty bugs in master that made the initial experience quite disappointing. Most of the bugs had Pull Requests opened, but still pending to be merged. So I decided to adopt the package to give it some love, and since last week, the melpa link points to my repo instead of @myuhe's.

Big props to the original author and also the many users of the module that helped with the migration.

If you use org-gcal, my recommendation is to update the package, and it will only improve your experience. There's an ongoing big refactoring that uses oauth2.el to manage all the tokens and oauth, but it still have issues that I haven't figured out how to solve in an elegant way.
Of course, if you have suggestions (or even better, code) for org-gcal, please direct them to https://github.com/kidd/org-gcal.el .

miércoles, 25 de julio de 2018

meta git-tip-of-the-day

curl https://raw.githubusercontent.com/git-tips/tips/master/tips.json |
     jq 'map([.title, .tip] | join(" --> ")) | join("\n")' -j | 
     shuf -n1

jueves, 28 de junio de 2018

TIL: dabbrev-expand in zsh

So just by chance I found that M-/ does a kind of dabbrev-expand in zsh.

And it took me a few seconds to realize that shouldn't happen in that context.

Or should it?

What's for sure is this is one of the coolest things you'll learn today about zsh.

domingo, 24 de junio de 2018

emacs-like browsing in firefox and chrome

In this post we'll see how to make ctrl-n work as "next-line" in chrome, firefox, or any other app in your linux box.

Browsing is my only daily computing activity I can't do inside emacs. There are browser extensions that make your browser behave like vim or emacs to a certain extent, which is very useful but they don't give a complete experience to the user (often because of limitations in the browse extension system).

Bear in mind that myself being an evil user and heavy hjkl fan, my configs use j and k sometimes to mean down and up.

History

Long time ago, there was conkeror. which gave a very emacsy browsing experience, but after the whole change on browser extensions, conkeror is a feasible option anymore.  The same happened to keysnail. There were also some nifty hacks using mozrepl, which are long gone now.

Vimium

The plugin is originally thought to give vim-like experience to chrome/firefox, but there's no reason you can't add shortcuts like "m-<" for "beginning-of-buffer" command.

Here's my config. Custom mappings:

Btw, pay attention to c-j and c-k. that's basically to be able to use j and k somehow in sites that override them (github, gmail). Also, note that we have a custom mapping for c-n and another for c-p, but unfortunately they do not work because those shortcuts are catched by the browser application before it arrives to the plugin.

gtk-3

This should be in your ~/.config/gtk-3.0/settings.ini :
With this you're allowing basic movements in address bar, search boxes, and input forms and text areas.

C-n? 

Yep, this is the tricky one. Both firefox and chrome take over ctrl-n, so you can't remap them and they always open a new window. Same happens with c-p showing the printing dialog. The trick then is to take over it ourselves going at Window manager level :).

In my case, I'm using ratpoison wm, so some of the commands used here won't work in your window manager, but you can find your way around using xdotool Look at this link for more info.

So we need 3 things:
  • - A way to guess which window is active (ratpoison -c "info") 
  • - A way to capture a keystroke (ratpoison's "definekey top" ) 
  • - A way to send an arbitrary keystroke to the active window. (ratpoison's "meta")
With these 3 capabilities, easy peasy:
It's dead simple, but I didn't write this till this week, and it's already made a huge difference in removing friction using firefox for me.

Bonus

If you write long texts in text areas, you probably want to check atomic-chrome with ghost-text.

Also, mooz, the author of keysnail is now working in a generalized solution for what I just explained for C-n, using python (and requires root privileges) called xkeysnail. It appears to be very powerful and super customizable. Also, windowmanager agnostic, so you should probably give xkeysnail a try.

Also, /u/attrigh suggests giving next browser a try. Written in Common Lisp, built using webkit, and with a much richer experience than all those hacks put together.  I haven't tried it yet, but it's worth looking at in the near future.