domenica 27 settembre 2009

A gimp plugin

Hello there!
Maybe someone still remembers my post about gimp-scripting with script-fu... Well, a guy, Elia Weiss, sent me his nice plugin for The Gimp.
Its description is:

"creates a shadow (transparent) version of the image

i use this script for colorizing an img with CSS/HTML
i.e. I display the shadow img and change the bg color with CSS

if u use the original colors from the picture u should get almost the same picture
u can play with the black-point/white-point values for less/more gray...
though it doesn't change much...

it meant to be use with uni-color img, but works with any img.

tested on png, jpg, GIMP 2.6.6
it gives an error message: Error: illegal function
I dont know why (didn't had the energy to debug it) but it works fine for me any way
so I simply ignore it

see GIMP on-line help for installation instruction of script-fu

usage: open an image and run the script
Note: i test it only on a flat image,
with multiple layer it should operate on the current active layer

after running the script:
* delete invisible layer (optional)
* merge visible layer (optional)
* save with a different name (as png for keeping the transparent charecteristic of the image)
"

I thought it's nice and useful, so if you want to try it, well it's here

Thanks Elia for your contribution! I appreciated it! ;)

domenica 26 luglio 2009

A self-made function for emms

Very often, while I'm listening to my /home/val/music folder, I think "Mmm.. I would like to add this song to that playlist..", so I wrote this little function to add the currently selected track in the emms-playlist buffer in a playlist file. I didn't find a similar function, but if it exists, please warn me! :P


(defun emms-add-to-playlist ()
"Insert the currently selected track in emms playlist in a playlist file"
(interactive)
(setq song (emms-score-track-at-filename))
(setq playlist (read-file-name "Playlist file: "))
(find-file-other-frame playlist)
(insert (concat song "\n"))
(save-buffer)
)


Hope you'll find it useful.

domenica 19 luglio 2009

LOL!

M-x animate-birthday-present


Ahahahahahahahahahha! Amazing and unuseful! :P

sabato 27 giugno 2009

Mic-paren

Hello folks! I've been away for a bit 'cause sometimes I've got to study hard...
However... Today I tried a new extension: Mic-paren.
In long source code blocks can be useful to match the opening/closing bracket, in fact it shows in the echo area the opening/closing line and its number (absolute or relative).

Here's my config:

(require 'mic-paren)
(paren-activate)
(setq paren-message-show-linenumber "absolute")


I could be really satisfied by this minimal configuration, but tomorrow I'll read documentation to see what else I can pretend by mic-paren.

See you!

domenica 7 giugno 2009

Javascript mode

My lazy hands started to code again...

I have to develop a project for an exam, "Software Engineering". It is a Rails application with client interface written in javascript using extjs.

For this reason I had to install a javascript-mode extension, to correctly color and indent code :-)

I installed that.

As soon as I know it better I'll write my considerations here! If you already program in javascript using GNU/Emacs let me know your useful tips and tricks! ;)

cheers!

domenica 17 maggio 2009

Emacs Daemon - part2

I forgot... To close Emacs (and its daemon) you should not use C-x C-c but M-x kill-emacs ;)

Emacs Daemon

Hell folks! Today we'll talk about the new daemon capabilities of GNU Emacs.

Since Emacs 23 we can avoid that annoying waiting of .emacs reading... Yes, if you're an Emacs addicted like me, probably you have a huge .emacs too and waiting for Emacs to read it every time we start the program is really boring...

Emacs daemon comes to help us enjoy this software even with an enormous configuration, in fact we can start a daemon as soon as our Window Manager starts (I use GNU/Linux, dunno about Window$) and then call emacsclient. But there's another nice feature! With emacs daemon we can have, at the same time, clients on X and even in a tty... Wonderful...

Recapitulation:
1) we start emacs with --daemon option
2) we attach to it with emacsclient
2a) emacsclient -c launch an X client
2b) emacsclient -t launch a console instance

I put in my fluxbox startup script "emacs --daemon", and in my ~/.fluxbox/keys I put:
Mod1 z :ExecCommand emacsclient -c -n -a emacs
(-a says the alternate editor to start if the command fails)

Good bye and enjoy GNU/Emacs daemon!