You could take this post as a second iteration on this older post.
There are many urls that are fairly navigable on w3m (emacs-w3m that is). The less html-y the site is, the more confortable it is.
So here's a way to redirect gist links to the raw plaintext counterparts. I just wrote it in 5 minutes, and it's quite inestable, but for the moment, it Works On My Machine. I'll try to make it more general and robust in next few days (as always, with advice from davazp)
Btw, it doesn't work if there is more than 1 file in the gist.
jueves, 9 de febrero de 2012
lunes, 6 de febrero de 2012
new emacs mode: expand-region
There's a new mode for emacs that has recently came out. It's called expand-region, and it's probably the nearest we can get to text-objects in emacs. In fact, it's quite interesting that it can be extended for specific major modes.
I had much of the same idea 1 month ago, and tried to implement the same functionality, but failed miserably (kind of worked, but really ad-hoc and hackish).
The basic idea of the plugin is selecting incrementally different semantic units with the same shortcuts.
Mangars is the author, and has kindly applied a couple of pull requests I made (hey, it's my first collaboration in any emacs plugin). I basically added support for disabled transient-mark-mode, and extensions for feature-mode.
On the way, I found out that ecukes and espuds. Nice discover.
And here's my fork of expand-region (that hopefully, you won't need to clone, because the central one is magnars')
Musicz from 10 to 7

What music do you listen to while programming, or just working in front of the PC?
For me that's from Guns and Roses, the Doors, soul and acid jazz, to Fat Boy Slim, Propellerheads, Prodigy and psy-trance.
Here are some comments on HN related to what programmers listen to when doing their job.
* http://news.ycombinator.com/item?id=3547694
* http://djbolivia.blogspot.com/2011/04/music-to-code-by-volumes-1-3.html
And you? what do you listen to while programming?
PS: I got 0 comments on that, and knowing that just a few people reads my humble blog, and many of you are people I know, and I know you listen to music while programming, and on the other side, a good deal of programmers like to listen music while working, I'd love to have responses. otherwise, I get very little motivation to keep up with this blog. C'mon lazyweb. Let's see how it goes with G+.
sábado, 28 de enero de 2012
Lisp and the web (probably part 1)
I've tried some lisp frameworks with different intensities and approaches, without settling with anyone of those. Just looking around.
As a first approach, I'm going for the minimalist frameworks. Caveman (on top of Clack), and RESTAS.
My first experience is with caveman, as I want something really simple, and known. Not that I've worked with Sinatra/Rack nor Flask/WSGI, but at least, the architecture is more well known that with other fw like weblocks or RESTAS.
With Toni, we've been hacking a bit our way to do a super simple micro app. And we stumbled upon a few WTFs, or undocumented Caveman spots, or just blockers for us due to our lisp newbieness. Luckily, most of them are solved now :)
I'm now struggling with form-builder, and widgets (no docs nor examples at all). We'll see how it goes.
As a first approach, I'm going for the minimalist frameworks. Caveman (on top of Clack), and RESTAS.
My first experience is with caveman, as I want something really simple, and known. Not that I've worked with Sinatra/Rack nor Flask/WSGI, but at least, the architecture is more well known that with other fw like weblocks or RESTAS.
With Toni, we've been hacking a bit our way to do a super simple micro app. And we stumbled upon a few WTFs, or undocumented Caveman spots, or just blockers for us due to our lisp newbieness. Luckily, most of them are solved now :)
- In GETs, (getf params :id) work, but in post POSTs, the symbols are presented in a different format (getf params :|id|). As davazp pointed, this probably has some problems issues with CL never garbage collecting those interned symbols.
- clsql:*default-database*. clsql will use *default-database* database handler if you dont's specify any. This makes using clack's middleware for clsql transparent from caveman apps.
- Getting caveman through quicklisp threw some erros during installation. Installing newer version of sbcl just solved it. (http://comments.gmane.org/gmane.lisp.steel-bank.announce/111)
* new feature: SB-EXT:VALID-TYPE-SPECIFIER-P returns whether a given type
specifier is valid where "valid" basically means "would be accepted as
second argument of TYPEP".
- cl-project doesn't create the link in ~/quickload/local-projects on new generated projects . If you create your projects under ~/quickload/local-projects, quicklisp will be able to quickload it, but if you put it somewhere else, you should create a link to your project.
I'm now struggling with form-builder, and widgets (no docs nor examples at all). We'll see how it goes.
miércoles, 25 de enero de 2012
stylish ruby
Here you have a couple of style guides related to ruby, rails, and some tips on functional programming and a few not-so-trivial techniques like currying, TCO, or just using immutable structures.
Apparently, all things explained in all those guides are obvious, or just a matter of taste, but you better read those guides a few times each to make those rules stick in your head, just to be sure :)
First, a guide from bbastov (of emacs prelude fame), that's already in github and forked more than a hundred times, so we could say it's a community ruby style guide.
Second, another bbastov's guide, this time on Rails 3.
And last but not least, slides of a friend of a friend's workshop on Functional Ruby. Really nice, and full of nice tricks that deserve to be read and understood.
That's all for now. Back to hacking
Apparently, all things explained in all those guides are obvious, or just a matter of taste, but you better read those guides a few times each to make those rules stick in your head, just to be sure :)
First, a guide from bbastov (of emacs prelude fame), that's already in github and forked more than a hundred times, so we could say it's a community ruby style guide.
Second, another bbastov's guide, this time on Rails 3.
And last but not least, slides of a friend of a friend's workshop on Functional Ruby. Really nice, and full of nice tricks that deserve to be read and understood.
That's all for now. Back to hacking
viernes, 20 de enero de 2012
XML < JSON < SEXPS
Step by step, I keep getting more and more of what's lisp about.
Not just the syntax (huh?) or the core lib, but idioms, design decisions, and the vision.
One of the mottos of Lisp is the famous 'code is data, and data is code'.
For me, that's not 100% clear yet, but I get more insights every day.
One implication of this is when you look at s-exps and see them as a datastructure, not as code. That's the macro point of view. If you want to know more about macros, I can only recommend you Paul Graham's OnLisp, and Doug Hoyte's Let Over Lambda. I'm now reading through the latter and I find it a perfect companion for OnLisp.
The other direction is 'data is code'. To exemplify this side, here are a couple of links that really get to the point of this (at least one part of the point).
- http://irreal.org/blog/?p=398 <= One of a series of posts comparing xml to sexps. Quite long and insightful
- http://shinkirou.org/blog/2010/06/s-expressions-the-fat-free-alternative-to-json/ => xml->json->sexps.
Cya
Suscribirse a:
Entradas (Atom)