Spiga

jQuery UI bootstrap tabs remember last selected tab

April 15, 12 by Gabi Solomon

I have started working with Bootstrap UI from Twitter and i love it. I had some trouble though with the tabs component that did not remember the last tab selected on refresh.

You can easily edit the component to allow for this feature:

- comment the line bellow from the TAB DATA-API

// e.preventDefault()

- add the following code below the TAB DATA-API

$('ul.nav-tabs li a[data-toggle="tab"]').each(function(){
if ($(this).attr("href") == window.location.hash) {
$(this).tab('show')
}
});

- add an anchor to all your tabs links

Easy deploy your applications from SVN with Springloops

March 14, 12 by Gabi Solomon

When you are an one man band, coding any project doesn’t raise to much logistical problems. You can’t work with ought Version Control and deployment may be as easy as overwriting all files by FTP. When you start to at least another developer on the project, then things get tricky.

You would need some Version Control and of course you will need some deployment strategy. This is Springloops comes in. Not only does it give you an version control repository (Git or Subversion) for your project but it also provides an automatic process of deploying your app, either by FTP, SFTP, FTP over SSH and even to Amazon S3. Read the rest of this entry »

Database design example for a configurable product eshop

January 07, 11 by Gabi Solomon

I was building an e-shop and one of the requiremens was to have configurable products.
The configurable parts will need to have different prices and stocks from the main product.  Also the shop must be able to move products from one category to another.

So i started thinking of a database structure that will enable me to accomplish this. As i started to research i also posted a question on stackoverflow to see what others had in mind.

Read the rest of this entry »

Error: svn attempt to write a readonly database, commit failed

November 09, 10 by Gabi Solomon

After upgrading our server subversion to 1.6.2 on a new repo i run into this error when commiting:

svn attempt to write a readonly database
commit failed

Although if i looked at the repo the commited files were there.

After hunting Google a bit, I found the problem to be with the “/svn/repopath/db/rep-cache.db” file that did not have write permissions for the user subversion uses.
After fixing permissions, committing went perfectly with no errors.

Hope it helps.

Access Dropbox.com behind corporate / company firewall

May 19, 10 by Gabi Solomon

If you find yourself one morning with your dropbox client not connecting to the server, and you trace the problem to the company/ISP ( or country if your in China :-p ) firewall then you can put the kind words for them to the side a little and try the following.
Most of the firewalls block the main IP for dropbox.com 174.36.30.70 but the alternate IP is open :D

So add this to your hosts:
174.36.30.71 www.dropbox.com

Hope it works for you.

php adwords api library

December 25, 09 by Gabi Solomon

Recently i posted on google code a library we developed to interact with Adwords Api from php.
Php Adwords API Library was developed by Hyperactive team for an internal project, since we didn’t like options available and felt we could do something that would be easier to work with, at least for us. We made it public so that others looking for a php library to interact with adwords api would have more options to chose from ( plus free testing for us :-p ).

The project can be found here:
http://code.google.com/p/php-adwords-api/

It is still a work in progress and does not yet support all the services and functions of the API, but we hope to add more services as soon as possible. And if you need a certain service or function please dont hesitate to add a ticket on google code and request it.

You will find examples of usage in the folder examples of the library.

PDF Generation with Zend Framework

November 07, 09 by Gabi Solomon
Jonathan MaronGuest Post by:
Jonathan Maron has been working in the web application conceptualization and development space since 1996. His current position is with an international company, specialized in the production of word processing components. Being an advocate of the FOSS movement, Jonathan promotes the use of Open Source software and rejects the notion of reinventing the wheel, preferring to develop with established frameworks.

Generating print-ready well-formatted PDF documents with PHP is not an easy task. Traditionally, there are two main approaches to PDF generation with PHP. Given sufficient time and patience, both partially get the job done, but still leave a lot to be desired:

HTML-to-PDF: This approach is widely used in mainstream applications. Here an HTML document is programmatically created and converted to a PDF, using one of the many open source libraries 1. Since HTML, however, is not a page-oriented format (as is PDF), it is impossible to perform a 1-to-1 mapping between HTML and PDF. Typical word processing file format features, such as header and footers, orphans and widows or even page numbers can simply not be represented in HTML.
Read the rest of this entry »

Running for charity

September 09, 09 by Gabi Solomon

I havent posted in a while, will try and restart, but for now i am writing this non-geek related post.

I’m taking part in the Berlin Marathon 2009 on 20/09/2009 to raise money for British Heart Foundation and would really welcome your support.

Please take a moment to sponsor me. It’s really easy – you can donate online by credit or debit card at the following address:

http://original.justgiving.com/gabrielsolomon

All donations are secure and sent electronically to British Heart Foundation. If you are a UK taxpayer, Justgiving will add an automatic 28% bonus to your donation at no cost to you. Please join me in supporting British Heart Foundation and a fabulous cause!

Thanks and best wishes.

Replication / Mirroring as Master-master with Subversion using svnsync

June 26, 09 by Gabi Solomon

For me it all started when my VPS had an error and all my SVN repos were lost. Plus even though i had purchased a backup system from the hosting company that was suppose to do a full server backup automatic and incrementally, i only had a backup from 20 days earlier because the system failed at that point in time and didnt run since.

But enough with my problems, at that point i decided to make a copy of my repos from the remote server to my local machine.
And i would commit into the local one and it should automaticly sync to the remote one. Plus it would need to do this both ways and in real time since i had some external people commiting in the remote server. Easier said then done i camed to find out.

The reasons why

Well for me there are 3 main reasons:
1. as a backup system ( dont want to be put in the 20 days old backup situation again )
2. for faster commits and updates
3. independent of the internet connection ( it hasnt failed in quite a while, but just in case, or for the times its a bit slow )

The alternatives

It seems that this topic is a bit popular, and there are a few places on the internet where people are interested in this. You can check out this question on stackoverflow for one.

1. Git-SVN
This is one alternative that a lot of people have been recommended. The benefits they are you get the best out of both worlds, you can still use the Subversion in the main repo, but you get the power of GIT for your local copy.
Although this sounds very cool, i am more of a GUI guy and really enjoy the subversion integration in my IDE ( Netbeans ) so i would have to pass this options.

2. SVK

svk is a decentralized version control system built with the robust Subversion filesystem. It supports repository mirroring, disconnected operation, history-sensitive merging, and integrates with other version control systems, as well as popular visual merge tools.

At first i read this article about SVK and it seemed to be what i was looking for. But after playing with it for a while i saw that i would need to have a single repo where all my comits would go and that would be synced to several outside repos. But i was looking for a way to have the exact replica of what it is on the remote server so in the case of a failure i could restore them from my backup.

If you are still interested in this you can also read this and this.

3. svnsync + webdav proxy
I knew about svnsync but it only supports read-only copies of your repo. But after reading a small comment on stackoverflow i started looking and find out you can have read-write copies using svnsync and webdav proxy.
What is basicly happening is that your local copy handles the read operations and it forwards the commits to the main repo.

There are a few tricky parts on this solution, that involve the locks and updating of all the replicas of the main repo. This are done by a series of hooks in the main repo.
If youre interested in this solution you can find information about implementing it in this articles:
Subversion transparent proxy with svnsync + webdav proxy
subversion diy write through proxy
Subversion on-the-fly replication

conclusion

Honestly i don’t have one yet :( , but i plant to try using svnsnyc and see how that goes.
I hope you got a big picture of what your options are and now you can decide what suits you best.

Cheers

audit_log_user_command(): Connection refused

by Gabi Solomon

This error happend to me when i runned a command on my Centos VPS.

audit_log_user_command(): Connection refused

And after some googling it seems that a lot of Centos users are running into this when executing SUDO.
But it seens that this is a bug in Centos kernel, and its not fixed yet.
My problem was that i was running the commands logged as root ( silly me ).
Hope you are too, because otherwise i have no sollution for you :( .

Cheers