Category Archives: Software development

AutoSnippet – automatically generate HTML and javascript code snippets


Code snippets posted online are a great source of knowledge and simple way to share experience and to reuse code. As developers we always look to see if there is a ‘code example’ which we can modify to our needs. As bloggers we find code snippets very useful to get our information out to the readers.

The problem is that creating these code snippets is a complex and cumbersome task. You need you replace all the < with &alt, wrap the code in <pre> and <code> tags and then use a Syntax Highlighter to make our code look nice. Every time we change or fix the code you need to reiterate this process.

AutoSnippet solves this problem by automatically generating the code snippet from the source code (HTML, CSS and Javascript). No more cumbersome repetitive tasks and no more inconsistencies between example and real code.

In this article I will show how to generate automatic snippets for your blog and source/code websites.




 

Usage:

HTML and javascript goes here

1) Example of code and its automatic snippet(with Syntax Highlighter)

The following code snippet on the left is automatically generated with SyntaxHighlighter. As a developer you just write the code and the autoSnippet generates the snippet itself.

Just write

code and the snippet is automatically

generated on the right ->

Here is how it is done:

2) Example of code snippet only (with Syntax Highlighter)

The following code snippet automatically generated with SyntaxHighlighter.
To get the ‘snippet only’ affect you need to put the source div over the target div.
again, as a developer you just write the code and the autoSnippet generates the snippet itself.


Just write

code and the snippet is automatically

generated here!

Here is how it is done:

3) Simple Example – with no Syntax Highlighter:

AutoSnippet can integrate with other Syntax Highlighter. Here is AutoSnippet at its simplest form.

just code 🙂

Here is how it is done:

Auto snippet is easy to use- it is a jquery plug-in and uses SyntaxHighlighter for syntax highlighting. Both of SyntaxHighlighter and jquery are common and well established open source projects. AutoSnippet is easily extendable and is released under the MIT open source license.

download and docs

Formal documentation and download can be found here.

IPWEditor – In-Place WYSIWYG Editor with FCKeditor and JQuery Editable


An In-Place editor, such as jQuery Editable plug-in, lets you seamlessly replace texts on web pages with inputs, for on-the-spot editing (see example 1). WYSIWYG editors, such as FCKeditor, provide easy, word-like editor on the web (see example 2). Basically, the two are advanced User-Interface JavaScript tools that help users edit content on the web in an easy, intuitive and productive way.

Wouldn’t it be great if we combine the two to create a really cool, web 2.0 user experience for editing content on the web? Unfortunately, FCKeditor and Editable are not fully compatible and some tweaking is required to make them interoperable.

In this article will demonstrate how, with little modification, FCKeditor can be integrated into Editable to create an In-Place WYSIWYG editor (see example3).

If you want to skip this documentation and just go to download the code and examples you can do so here.

Continue reading

Software As A Service Takes The “Free Beer” Out of Open Source


Free software means that computer users have the freedom to cooperate with whom they choose, and to control the software they use. To summarize this into a remark distinguishing libre (freedom) software from gratis (zero price) software, Richard Stallman said: “Free software is a matter of liberty, not price. To understand the concept, you should think of ‘free’ as in ‘free speech’, not as in ‘free beer’.1

The reality is quite different from this philosophy. Up until now open source software was, for most people, free beer rather than free speech. Well, the beer party is over, and cooperate companies have a new business model strategy called SAAS.
Continue reading

Apache Crashes on Windows – Check Your Ports

Apache is one of the most popular web servers in the market today. It usually runs on Linux-based machines but lately there are more and more deployments, for development as well as other reasons, of Apache on Windows. Nowadays, running Apache web server on Windows is very common for PHP developers. Many developers develop their PHP application on their home windows or Mac and deploy to a remote Linux server.
Continue reading

PHP Transparent Database Access layer – PHP Object-Relational Mapping (PHP ORM)

The combination of Relational Data (database) and Object Oriented Programming (OOP) is not a match made in heaven. The way we work with objects is totally different than the way we access Data. The problem is that in most projects you need to access data and write Object Oriented Classes to display and manipulate that data.
Continue reading

Effective Development Environments – Development, Test, Staging/Pre-prod and Production Environments.

The following happens in many software projects –
At start, it seems you only need one environment for your web application, well, at most two:
One development environment (AKA your PC) and one server.

But as time pass, you find you need additional environments:
The clients might want their own testing environment, sometimes you need to have a pre-production environment or a staging environment, so business managers can approve the ongoing content as well as look & feel.

Do you really need these environments? What are these environment good for?

Here is a short description of some of the more popular environments and their purpose.
Continue reading

How much should a web site really cost?

Lately I have been asked by many people how much should they pay for a personal or small business website. It seems that these are good times to get some extra cash from a web initiative.

The problem is that, for most people, building and hosting a website is somewhat of a mystery. And when people treat something as a mystery they tend to over complicate it and over pay for it. Some people I talked to spent 20-100$ on simple basic hosting alone! That is, in most cases, more than what they need to pay.
Continue reading

How to do cross browser sanity testing in less than 5 minutes for free

Cross browser, cross operating system testing is a costly and tedious task. Most often we test our web application on the Internet Explorer and Fire Fox installed on our machine and hope for the best. In big projects with rigid compliance requirements we test the major operating systems (Apple, Windows and sometimes a popular Linux distribution) with the major Browsers. The underline assumption is that this covers 99.x% of the population and we are happy with that. But what if we could, without additional cost, see how our web site looks like in many operating systems and multiple browsers?
Continue reading