#!/usr/bin/perl -T
# obscurity through security
use warnings;
use strict;
use CGI qw/header param escapeHTML/;
my $VERSION = v0.4.4;
my $revision = sprintf("версия %vd", $VERSION);
my $encoding = "utf-8";
my $lang = "bg";
print header("text/html; charset=$encoding");
# list of nice unicode characters:
# greek letters, arrows, math signs
my @nice_chars = qw(167 168 171 176 402 916 920 937 945 946 947 948 957 959 960 961 964
969 8220 8222 8593 8594 8747 8240);
# choose a random nice char from the above list
my $nice_char = "&#".($nice_chars[int(rand($#nice_chars+1))]).";";
open SELF, $0 or die "Cannot open self: $!";
my @lastmod = localtime((stat SELF)[9]);
#build a d.m.Y formatted 'last modified date'
my $lastmod = sprintf("%02d",$lastmod[3]).'.'.sprintf("%02d",$lastmod[4]+1).".".($lastmod[5]+1900);
my $startyear = 2004;
my ($curryear) = ((our $tmp = (localtime)[5]+1900)>$startyear?"$startyear - $tmp":$tmp);
print <<HTML_HEAD;
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="$lang" lang="$lang">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=$encoding"/>
HTML_HEAD
my $showsrc = param('showsource') || '';
if ('yes' eq $showsrc) {
print <<SOURCE_HEAD;
<title>Изходен код</title>
<style type="text/css">
#source {
font-family: monospace;
white-space: pre;
}
</style>
</head>
<body>
<div id="source">
SOURCE_HEAD
print escapeHTML($_) while(<SELF>);
print <<SOURCE_FOOT;
</div>
</body>
</html>
SOURCE_FOOT
# print real page, not the source
} else {
print <<PAGE_CONTENT;
<title>Николай Бачийски - бюро информация</title>
<style type="text/css">
html, body {
height: 100%;
margin: 0;
padding: 0;
border: 0;
}
body {
font-family: "Trebuchet MS", sans-serif;
font-size: 0.7em;
margin: 4%;
}
div {
padding: 0;
margin: 0;
border: 0;
}
#container {
position: relative;
}
#content {
position: relative;
}
#heading h1 {
font-family: georgia, serif;
color: rgb(40,40,40);
font-size: 1.7em;
display: inline;
}
#heading h1:hover, .cell h1:hover {
color: rgb(120,0,0);
}
#heading h2 {
font-family: georgia, serif;
color: rgb(80,80,80);
font-size: 1.1em;
display: inline;
}
.cell {
padding: 1% 2% 2% 2%;
margin: 1%;
border-bottom: 1px solid rgb(5, 49, 136);
border-right: 1px solid rgb(5, 49, 136);
background-color: rgb(249,249,249);
float: left;
vertical-align: top;
width: 43%;
border: 0 green solid;
}
.cell h1 {
font-family: arial, sans-serif;
font-size: 1.3em;
font-weight: bold;
font-style: normal;
text-decoration: none;
color: rgb(5, 49, 136);
}
.cell dt {
font-style: italic;
}
.cell dt:after {
content: ':';
}
#about, #bio {
height: 16em;
}
#emptycell, #contact {
height: 20em;
}
#emptycell {
background-color: white;
text-align: center;
vertical-align: middle;
}
#emptycell span {
font-size: 12em;
font-family: serif;
}
.cell:hover, #contact:hover, #about:hover, #bio:hover {
background-color: white;
}
#footer {
width: 100%;
font-size: 0.9em;
text-align: center;
border: 0 solid red;
clear: both;
}
#footer li {
display: inline;
}
#footer li:after {
content: ' | ';
}
#footer li.last:after {
content: ' ';
}
a:link {
color: rgb(20,40,200);
}
a:visited {
color: rgb(10,20,100);
}
a:active {
color: rgb(120,0,0);
}
a:hover {
text-decoration: none;
background-color: rgb(210,210,210);
color: rgb(20,40,200);
}
acronym {
cursor: help;
}
</style>
</head>
<body>
<div id="container">
<div id="content">
<div id="heading">
<h1>Николай Бачийски</h1><h2>:: бюро информация</h2>
</div>
<div class="cell" id="about">
<h1 title="В това каренце ще разберете защо все пак съществува това място">Що е то?</h1>
<p>Наоколо може да намерите отговори на някои <acronym title="често задавани въпроси">ЧЗВ</acronym> за мен.</p>
<p>Отвъд сухите факти се намира моят личен дневник - <a href="http://nikolay.bg/" title="Връзка към уеблога">Аз, света и сметачите</a>. Едно малко по-специално място, където оставям по-специални неща. Както и по-обикновени. Мои. И ваши. И лични. И споделени.</p>
<p>Моля, все пак не забравяйте, че не мога да пренеса цялото си „аз“ в интернет. А и не искам.</p>
</div>
<div class="cell" id="bio">
<h1 title="Малко биографични бележки">Био</h1>
<dl>
<dt>Рожден ден</dt>
<dd>2-ри септември 1984</dd>
<dt>Презиме</dt>
<dd>Чавдаров</dd>
<dt>Работа</dt>
<dd>babelfish engineer \@ <a href="http://automattic.com/">automattic</a></dd>
<dt>Образование</dt>
<dd>бакалавър, <a href="http://www.fmi.uni-sofia.bg" title="Факултет по Математика и Информатика">СУ::ФМИ</a>, информатика</dd>
<dd><a href="http://www.pmgvt.org" title="Природоматематическа гимназия 'Васил Друмев'">ПМГ „Васил Друмев“</a> – випуск ’2003</dd>
</dl>
</div>
<div class="cell" id="emptycell">
<span title="Различен весел символ при всяко презареждане">$nice_char</span>
</div>
<div class="cell" id="contact">
<h1 title="Ако желаете да се свържете с мен...">Контакт</h1>
<dl>
<dt>Електронна поща</dt>
<dd><a title="За препоръчване пишете на този адрес" href="mailto:nb\@nikolay.bg">nb\@nikolay.bg</a></dd>
</dl>
</div>
</div>
<div id="footer">
<ul>
<li title="Нее, няма да ви кажа и в колко часа">Последно обновяване: $lastmod</li>
<li title="малко магически числа...">$revision</li>
<li><a href="http://validator.w3.org/check/referer" title="Проверка за валиден XHTML">xhtml</a> <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Проверка за валиден CSS">css</a></li>
<li class="last"><a href="?showsource=yes" title="Преглед на кода, който генерира тази страница">изходен код</a>
</li>
</ul>
<a title="Мъничкото съдържание на тази страница е под CC Atrribute лиценз" href="http://creativecommons.org/licenses/by/3.0/deed.bg">Някои права запазени</a> $curryear Николай Бачийски
</div>
</div>
</body>
</html>
PAGE_CONTENT
}