https://github.com/volftomas/easymail
Wednesday, August 15, 2012
Easymail
I needed simple way for sending emails from python (debug info from server app), so I created VERY simple library to wrap smtplib into something more useful. Here is a link:
Friday, August 3, 2012
Claws mail python plugin
I am using Thunderbird right now, but as I got new PC I will be installing Archlinux on it, so I ask myself if it's time to move to something lighter and more extendable by plugins.. as I like Python, using python as plugin language would be great.
I picked Claws-mail which is a great, capable and lightweight email client supporting both GPG encryption/signing and Python plugins..
But there is virtually no documentation on writing those plugins :'( So I just tried it, open console from claws-mail menu and tried it as described in demo.
But I got
I will probably make some kind of tutorial for this (python plugins in claws mail) so no one else have to do the "digging".
I picked Claws-mail which is a great, capable and lightweight email client supporting both GPG encryption/signing and Python plugins..
But there is virtually no documentation on writing those plugins :'( So I just tried it, open console from claws-mail menu and tried it as described in demo.
But I got
When I tried accessing clawsmail modul. After a while, I found that all you need to do is first import clawsmail modul.Traceback (most recent call last):File "<string>", line 1, in <module>NameError: name 'clawsmail' is not defined
import clawsmailSimple ^_^
I will probably make some kind of tutorial for this (python plugins in claws mail) so no one else have to do the "digging".
Tuesday, July 31, 2012
lookbehind regex in PHP
Today, I was facing a problem how to split something like following text
After a little searching, I founded that solution lies in lookbehind regular expressions.. Nifty things ^_^
This
a="Some Text" b="Some more Text" c="Even more text about \" this text\"" d="aaaaaaa"into array, into pairs key => value. I couldn't just use explode(), because spaces could be inside the quotes..
After a little searching, I founded that solution lies in lookbehind regular expressions.. Nifty things ^_^
This
/(?<![\\\|=])\" /expressions would split it into following array:
so exactly what we wanted :)array (0 => 'a="Some Text',1 => 'b="Some more Text',2 => 'c="Even more text about \" this text\"',3 => 'd="aaaaaaa"',)
Tuesday, July 24, 2012
YaCy on Archlinux
Today I decided to deploy YaCy on my VPS running Archlinux. I installed package and all went well until I noticed, that no images are being displayed. After some searching (30 minutes?) I finally figured it out.
To correctly show (generated) images, YaCy requires X Server and libcups, even on server running only in console.
I already requested adding those two packages into dependecies, but until it's done, if you having problem running YaCy without X server, just run "pacman -S xorg-server libcups" and it should be ok.
To correctly show (generated) images, YaCy requires X Server and libcups, even on server running only in console.
I already requested adding those two packages into dependecies, but until it's done, if you having problem running YaCy without X server, just run "pacman -S xorg-server libcups" and it should be ok.
Tuesday, June 12, 2012
PHPUnit_Util_Log_XML
I was doing some work in PHPUnit and one of the request from company was export to xml.. So I was thinking, how to do that? I found some tutorials online, but I run into error Class 'PHPUnit_Util_Log_XML' not found in...
I found out that PHPUnit_Util_Log_XML was renamed into PHPUnit_Util_Log_JUnit ...
I just thought I can save someone searching..
I found out that PHPUnit_Util_Log_XML was renamed into PHPUnit_Util_Log_JUnit ...
I just thought I can save someone searching..
Monday, July 11, 2011
CodeIgniter form helper
Today, I was developing some form generating script for one guy and I need a quick way for creating form. For this purpose I used to use Form class from Nette framework, but I requires a bunch of files etc., so it was a little overkill for my script consisting of exactly one file.
So I remembered, that CodeIgniter has form helper, which was exactly what I needed. But there was problem, this helper was dependent on the framework itself, it was not just "set of standalone functions".
So I stripped it down, removing call for framework and leaving helper file, which can be used as standalone script.
If I remember correctly now, there is only one different to original helper. My helper is set only for 'accept-charset="UTF-8"' but original gets this setting from framework. I was thinking about add possibility to set this, but because helper is a bunch of functions, there is not any static variable you can just set (I wanted to avoid name collisions...). And anyway, who is not using UTF-8 now, right?
But it is on github, so if someone has meaningful changes (like accept-charset, new functions, ...), do not hesitate to commit your code.
There is the link: https://github.com/volftomas/Standalone-form_helper
So I remembered, that CodeIgniter has form helper, which was exactly what I needed. But there was problem, this helper was dependent on the framework itself, it was not just "set of standalone functions".
So I stripped it down, removing call for framework and leaving helper file, which can be used as standalone script.
If I remember correctly now, there is only one different to original helper. My helper is set only for 'accept-charset="UTF-8"' but original gets this setting from framework. I was thinking about add possibility to set this, but because helper is a bunch of functions, there is not any static variable you can just set (I wanted to avoid name collisions...). And anyway, who is not using UTF-8 now, right?
But it is on github, so if someone has meaningful changes (like accept-charset, new functions, ...), do not hesitate to commit your code.
There is the link: https://github.com/volftomas/Standalone-form_helper
Statement
I do not really expect someone to read this.
So what is a purpose of this blog?
I need a easily searchable place to store non-private ideas, notes etc.
Subscribe to:
Posts (Atom)