Sunday, July 22, 2012

Back to Shareware :)

I have never ever planned back to shareware business, but one of my technical tasks requests testing of modern software protection and integration with billing services. So I've decided to make a small utility and push it to all required tests.

I have many ideas and feature requests form users of free Keyboard LEDs software, so there was no problem with idea of new software. So, here it is: Caps Lock Indicator

Caps Lock Indicator software for Windows
Download EXE file
Download ZIP Archive

Software for Windows, offers two Caps Lock state indicators: Tray Icon and On-Screen Floating Text. Notifications by sound are also available. The product is distributed as shareware with 30-day trial period. The license costs $9.95 per user.

Sunday, July 08, 2012

Credit Card Joke

Anybody knows is it legal to make funny stuff like that:

Credit Card Joke

I don't want to get any subpoena :) Maybe some kind of legal notes are required?

Wednesday, July 04, 2012

Picture of the Day

I've created own Picture of the Day service.

It took about 3 hours at night while I was fighting the insomnia...

Monday, June 25, 2012

Random Color Generator and Preview


I've created the online color viewer.

Everybody can preview any color using this base URL: http://karpolan.com/services/color/

Want to see a green color? Here it is: http://karpolan.com/services/color/008000/

A dark blue one? No problem: http://karpolan.com/services/color/000060/

Also, there is the Online Random Color Generator there.

Wednesday, June 06, 2012

Wednesday, May 30, 2012

Europe by Car

Video of our trip "Around Europe" from a camera on windshield of the rented car.

We have visited Amsterdam, Rotterdam, Kinderdijk, Antwerpen, Brugge, Blankenberge, Gent, Brussels, Namur, Longwy, Luxemburg, Bitburg, Liege, Maastricht, Eindhoven.

Friday, October 28, 2011

PHP - Print any variable easily

You often need to print some PHP variable right into the HTML code, but the variable is out of your current scope. Familiar problem, isn't it?

Here is a bright solution: PHP function that prints any global variable:


function print_var($var = 'domain', $url = '')
{
  global $$var, $$$var;
  if ($url != '')
    echo("<a href=\"$url\">${$var}</a>");
  else
    echo(${$var});
}

Moreover, you can pass some URL as a second parameter, and your variable becomes a clicable link :)

Some examples:


<?php print_var('page')?>
<?php print_var('domain', '/') ?>
<?php print_var('software', '/download/') ?>
<?php print_var('author', 'http://www.site.com') ?>

Sunday, October 16, 2011

Wordpress + Custom Scripts = Error 404

Wordpress is the most popular CMS in the world. Many sites are powered by Wordpress, plugins almost for every need are available. But...

If you decide to add some custom web scripts or other CMS to the domain where Wordpress is already installed, you'll get a problem with Error Handling. Wordpress shows Error 404 (File not found) for any URL that is not a part of Wordpress system!

Moreover, Wordpress changes standard error pages to its own ones. So if an error occurs outside Wordpress environment, the error message appears in Wordpress style anyway!

This can be fixed using .htaccess settings. At first you should exclude work folders form RewriteMode redirections. Add the following line into .htaccess file in the root of your site:

RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^/(folder1|folder2)/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress /index.php [L]

Then you should disable custom error page, at least in folders of your scripts. Add the following line to .htaccess files in your script folders. You can add this line to the root file as well, but sometimes it doesn't work:

ErrorDocument 404 default

This is enough if Wordpress is installed into a folder. But if Wordpress is installed into the root of the site, the solution may not work depending on CMS version and installed theme. Most probably you will need to fix some files manually to disable 404 error handling. The core is located in class-wp.php file:

function handle_404() {
...
$wp_query->set_404();
status_header( 404 );
...
}

BTW, Wordpress in the root of the site is not a best practice...