Isikukoodi valideerimine

Friday, May 29, 2009

Filed under: Java, PHP, Ruby — Tags: , , , , — Dmitri @ 11:29

Leidsin täna seda → Isikukood. Algoritm on selge aga näidese kood on räpp…

Siis…

Versioon PHP by Setor
Versioon PHP 2 by MiamiBC (kõige lihtsam ja arusaadavam)
Java version by Incubo
Minu versioon Ruby keeles
Mika Tuupola versioon JavaScript

Kui sul on mingi teine versioon siis saada mulle ka ;-)

Notify bar

Wednesday, May 27, 2009

Filed under: PHP, jQuery, javascript, web-development — Tags: , , , — Dmitri @ 12:11

‘Notify Bar’ plugin

Simple plugin (basically it’s not a plugin, but widget) to show notify bar
(like on Twitter’s webpage).
It’s very simple to use:

      
$(function () {
  $.notifyBar({
    html: "Thank you, your settings were updated!",
    delay: 2000,
    animationSpeed: "normal"
  });
});
      
    

and to your html page stylesheet:

<link rel="stylesheet" href="jquery.notifyBar.css" type="text/css" media="screen"  />

$.notifyBar can pass next parameters:

Parameter Description Type Default
html What text will be inside bar, can be HTML String [optional] “Your message here”
delay How long bar will be delayed, doesn’t count animation time. Integer [optional] 2000
animationSpeed How long this bar will be slided up and down String | Integer [optional] “normal”
jqObject Own jquery object for notify bar jQuery object [optional] null
cls You can set own CSS class for ‘Notify bar’. There is too premade clasess “error” and “success” String
close If set to true close button will be displayed Boolean false

See demonstration or download source.

Plugin ‘Minify’ for Frog CMS

Wednesday, May 20, 2009

Filed under: PHP, web-development — Tags: , , — Dmitri @ 11:25

About Minify

‘Minify’ is a plugin to minify JavaScript and/or CSS code and combine it
into one file on the fly. This will increase performance of website.
So you don’t need to do dozens HTTP request for every JavaScript or CSS file.
Minify plugin is more useful and faster with Funky cache plugin.

How it works and how to use it.

IE session bug is solved

Thursday, February 5, 2009

Filed under: HTML and CSS, PHP, web-development, work — Tags: , — Dmitri @ 11:07

IE has bug which deletes session data and brakes functionality of website. In other browsers all is working fine.
Here is example in PHP:

<?php
print_r($_SESSION);
//output:
//Array ()
?>

After half day of breaking brain and Google really fantastic solution for this problem, but no one of them didn’t solved our problem. So Mika found that if markup have empty src attribute, IE makes an empty request which breaks session data. So solution is simple check if there any empty src attributes and hrefs in link tag.

Was:
<img src="" alt="An image" id="img" />

You need to remove this empty attribute or if you don’t need this for javascript remove IMG tag at all.
<img src="" alt="An image" id="img" />

That’s really stupid.

Official Estonian currency rates with PHP

Thursday, December 18, 2008

Filed under: PHP, Wrong world, jQuery, me, web-development, work — Tags: , , — Dmitri @ 13:35

I had a bit free time today and I have written a PHP class which gets the official rates for Estonian crown. This class will be useful for internet shops or any other commercial organizations who need to keep their courses fresh.

You can download or check source. This stuff is really simple as hell, anyway there is a small documentation inside archive.
Here you can see the most fresh Estonian currency rates

Why Obama has won?

Friday, November 7, 2008

Filed under: PHP, web-development — Tags: , , — Dmitri @ 10:52

New US. president Barack Obama wins elections because his site is written on PHP, but John McCain has ASP.NET site, so they are:

Obama vs McCain.

:-)

© 2008 Dmitri Smirnov