lunes, 27 de mayo de 2013

yet another git reset cheatsheet

After some time since my last git post, here I come again with a link to an explanation of wtf git reset is doing.

It's mostly the same as I pointed in a post 2 years ago, but just explained in a different way, shorter, and probably easier to print in a small paper and stick it in your table.

Enjoy :)

PS: There's a poll running on reddit about git clients. No matter what you're using, vote for magit :)

cool org-mode 8 features

This weekend I stopped playing with lua and finally got some time to upgrade org to the newest version.

Org 8 had lots of improvements and new features compared to 7.9.x.  There were a couple of those that I wanted to try as soon as possible:

  • New Exporters: org-mode now uses org-element to parse org files. That's a big big improvement because that allows users to write new exporters relying on a somewhat more abstract and high level parser api than what we had before.

  • orgstruct and orgstruct++ got orgstruct-heading-prefix-regexp option to set allowed prefixes and be able to fold parts of non-org files as if they where

On the exporters side, I tried org-reveal, and it works great so far. an exporter to make presentations using reveal.js   Probably I'll try it for real next week when when I'll be doing some talk at my workplace.

(require 'ox-reveal)
(setq org-reveal-root "reveal.js")

Meanwhile in orgstruct... being able to define prefixes for orgstruct-mode allows us to have foldable text files. For example, use the following line to make it work in elisp files.

(setq orgstruct-heading-prefix-regexp "^;; ")

miércoles, 22 de mayo de 2013

Lua vs javascript

I love lua.  Well, I luvit so far.

I haven't programmed many many things in lua, but the simplicity of it reminds me of smalltalk (in a veery different meaning of simplicity), or scheme.

The fact that it relies in very few known concepts as lexical scope, tables, and.... and that's it.

More that a language, is a language builder toolset.  It lets you do metaprogramming without really feeling that you're doing metaprogramming.  It makes it so simple you'd say it's "the normal thing".
  • loops? ok, you have 'for', and iterators. made from closures, or whatever, but that's it.
  • TCO? yes, but just if it's explicit.
  • splat arrays by default? as in Perl?... yes, just in the last position, perfect for apply-like calls. or you have unpack.
  • Varargs functions? yup.
With that and a bit of syntax sugar here and there, you have a really powerful language with near to no friction.  Provided you know a few other languages, you can always say: "ah, it behaves like js in the everything is hash, but it has proper scoping, and TCO ...."

I don't know much js, but I think lua is like a well done js.  Here's some funny Hacker News opinion

That and the community. #lua is full of people with background in many other languages, wise and helpful. and quite hacker style. I like it :)

Ah! and there's also metalua, which sounds like great fun. something like tcl's block syntax or lisp quasiquoting to mold lua to your needs.

sábado, 11 de mayo de 2013

Ryan Holiday TNW keynote: manipulating media

I'm having a hard time deciding whether to publish this entry or not, and which words to use to promote this video of Ryan Holiday where he talks about manipulating the media.

The media, and  how easy it is to generate buzz on the media and get traction. That guy might be some kind of marketing ninja.

So in TNW he did a talk about some experiences he had and how he sees the fragility of the truthiness in the media, and how they change mindful investigations for easy PR that will lead to easy clicks

If you watch the talk you'll understand the mixed feelings I had when writing about it. Hopefully the content is mostly correct and he's not playing on us.

Here is  the article, and the video: