GMlv

Invoicing

This currently is the best invoicing app I have discovered http://www.getharvest.com/

Updated!

Though there are some issues. For example translating is a nice thing, but it is global not per invoice. Mostly I need invoices in Latvian, but if I will need it in english I will have to translate it back and forth.

Finding a damn good wysiwyg editor

I need to find a good wysiwyg editor for a project i'm currently working on. Here are my thoughts on some of the editors:

  • TinyMCE: feature full editor, but it seems a bit messy with a lot of files. Implementing is also not very nice and friendly. Earlier I have experianced some problems validating html code.
  • FCKEditor / CKEditor: Some years ago it was called FCKEditor, now I see that they have renamed it to CKEditor. I have used this one quite successfully. This is definitely better that TinyCME. Just downloaded the source code and I see that download package consists of 579 files. Wow! I need some simple wysiwyg editor, not this huge. And directory structure is really messed up.
  • markItUp: 40 files - much better. Actually this is very interesting editor, althought it is not quite wysiwyg one. Judging from the example I have to replace "\n" to "<br />" within my code. I don't want to do that. And also for average user html code will not be easy to handle. On other hand pasting documents from word and websites will end up with better results. It is also nice looking. So there are some pros and cons to consider.
  • jWYSIWYG: So called jQuery wysiwyg editor. This one was my favourite for some time because of small footprint. It have only 3 files - js, css, and a gif file for a toolbar. Why I don't use it any more? Firstly it has a bad design. Next some features does not work very good on some browsers. There was some bug when slecting text in bold, toolbar do not show it is in bold. Also toolbar icons is somehow shifted. There was something else, I can't remeber now.
  • NicEdit: They have nice website, also nice looking editor. This one I am currently using, but I'm searching for something else because there is no "html code" button as well as it cannot clean messy html code. And you can image what comes with when you copy something from the microsoft word. However this is really nice editor with small source - only two files - ideal if you need just some bold, italic text and some lists.
  • openWYSIWYG: Didn't know about this one, so I gave it a try. 109 files in default archive. Quite much, but they seem good structured, not like Tiny and CK. From example I see, that it have table support, what does not have all those two files simple editors. Oh! It defines $ as shortcut to javascript "document.getElementById" function - this is bad, very bad, because I use $ to access jQuery. Ok, lets stop here: "openWYSIWYG does not support your browser" - I'm using google chrome. It seemed the good one... :(
  • FreeRichTextEditor: Another rich text editor. This one has interesting switching between editor, html code and first one I see - Preview. It looks good, but not very good. But it also seems somehow left alone. It has only one version and author writes new posts twice a year.
  • jQuery RTE, HtmlBox, dsrte, WYMEditor, Xinha, htmlArea, TTW HTML: I would choose none of these ones just because they have very bad designs and first impression about theire websites does it all even worse. Also I don't see any future for these ones.

 

Conclusion is that there is no prefect solution. Currently choices are:

  1. feature full, but ugly
  2. easy to use and implement, but feature less
  3. nice looking and easy to implement, but not friendly for users
  4. fully featured, but very heavy

 

By the way the best editor I have seen have wordpress and I see, that posterous is also using something similar. Maybe somebody knows if it can be downloaded separately?

 

Note about WYSIWYM editors.

I don't see where so called WYSIWYM (What You See Is What You Mean) editors could be handy, I would better use markup editor. If website admin is an average user, I guess he/she doesn't care if the text is in p tag, or div tag. One of these is WYMEditor. See example here: http://files.wymeditor.org/wymeditor/trunk/src/examples/01-basic.html

 

P.s. I am fan of jQuery, so I did leave out editors based on js libraries such as mootools, django, yahoo UI.

 

Filed under  //   html   RTE   wysiwyg   

Port forwarding

Yestereday it wasn't very creative day at work so I took a work with me using usb flash drive.

At work we have some paranoid IT security people who wont let us work from home, so if I want to do it, I have to copy source code onto the flash drive and setup similar configuration on my home computer. It is not the first time, so no problems with configuration, but copying, archiving, copying, unarchiving is a quite booring process. So I was thinking: "Is it possible to get to our work development server?". Asking for an access to IT is not an option in this case.

Then I remebered about port forwarding. Is it possible to connect to some server, create tunnel from connecting side and connect to this tunnel from other side? Of course it is possible. I guess I did know it before, just somehow haven't thought about it. What I need was a server. I can't use any server, again because of strict IT policy, but recently we rent a new server outside of our work environment for one project and I have an access to it from my work PC.

What should I do next?

Luckily for me port forwarding is included in ssh client/server and all I have to do is to put right parameters in command line.

I have to connect my computer to the server and open port xxx and yyy (ssh and www) that will be forwarded to our dev server at work (192.168.10.10 is an example for dev server in work's local environment):

ssh -R 127.0.0.1:xxx:192.168.10.10:22 -R 127.0.0.1:yyy:192.168.10.10:80 username@example.org

Switch -R means that we will be forwarding remote port to local. 127.0.0.1 is for security so no one else from outside world do not guess the port and avoid any vulnerabilities to the dev server. "xxx" and "yyy" is ports to open on remote machine. "192.168.10.10:22" is ip address and port where to forward incoming connections.

Next thing to do is create a tunnel from my home computer to the server. You can leave "127.0.0.1:" out from -R switch and connect directly to the server by opening http://example.org:yyy/ and ssh -p xxx username@example.org. Considering security expectations at my work I would choose to create a tunnel from my home computer to the server either.

This should do it:

ssh -L xxx:127.0.0.1:xxx -L yyy:127.0.0.1:yyy username@example.org

Where "-L" tells ssh to forward local incoming port to "xxx" and "yyy" to the server (127.0.0.1 is server's local ip address, what everybody knows already:) on port "xxx" and "yyy".

 

Now on my home computer I open http://127.0.0.1:xxx/ and it should open a default website from our dev server. As we use apache virtualhosts on our dev I would have to set some entries in hosts file to get other sites.

That's about it.

Letter from google analytics

Today I received an email from google analytics team. It makes me feel kind of proud. :)

Hello,

We love that you love our product and use it as much as you do. We have observed however, that a website you are tracking with Google Analytics is sending over 1 million hits per day to Google Analytics servers. This is well above the "5 million pageviews per month per account" limit specified in the Google Analytics Terms of Service. Processing this amount of data multiple times a day takes up valuable resources that enable us to continue to develop the product for all Google Analytics users.

As such, starting August 23rd, 2010, the metrics in your reports will be updated once a day, as opposed to multiple times during the course of the day. You will continue to receive all the reports and features in Google Analytics as usual. The only change will be that data for a given day will appear the following day.

We trust you understand the reasons for this change.

Regards,

Your Google Analytics Team

Getting data updated once a day is not a very good thing, but getting to it because of big amount of data is a good thing. :)

Just rode 30km on a bicycle

Now have to gain some energy. :)

MongoDB finding max value

Hi,Recently I have started to learn some new stuff. One of them is MongoDB so called “NoSQL” database.What I have learned is that mongoDB is very simple. Running MongoDB and installation of PHP extension for it, took only some 10 minutes. Then fast overview of some source code at php.net manual and we are good to go. If you have some earlier experience with javascript and databases like MySQL, you shouldn’t have any problems with MongoDB. This morning I started to migrate table from MySQL to Mongo and did a mistake. I changed table in MySQL query but did not changed it in Mongo insert. So what I had was two tables in one Mongo collection.Fortunately those tables has some fields that are not in other table, so I came up with this code:

self::$mdb->i18n->remove(array(':where' => new mongoCode('return (this.parent == 0 || this.parent > 0) && typeof this.last_access == "undefined";')));

Where “self::$mdb” is reference to php MongoDB object. I guess: “typeof this.last_access == "undefined”;“ would be just fine, either, but I used "this.parent” for double checking. Another problem with Mongo is to get max value of some field, so I decided to paste a code here to also remember this one if in case I need it someday. It finds max value of field “id” in collection “countries”.

$max_id = self::$mdb->execute(new mongoCode('
    find_max = [];
    db.properties.find([], {id : 1}).map(function(item){ 
        if (item.id) 
        {
            find_max.push(parseFloat(item.id)); 
        }
    });
    return Math.max.apply(Math, find_max);
'));

print_r($max_id['retval']);

It is pure JavaScript inside of Mongo, so if you know javascript getting advanced stuff out of Mongo should be very easy for you.

Filed under  //   Technologies   MongoDB  

Excavation and my coupe

   
Click here to download:
excavation-and-my-coupe-eIhbauHDfqJBemJpFzqh.zip (978 KB)

Old flowers vs new cactus

This weekend

Nomigrēju blogu uz posterous

Pavilka mani tā visa posterous ideja un izlēmu nomigrēt blogu. Pēc DNS cache refresh verot vaļā http://gm.lv/ vajadzētu parādīties posterous lapai.