#!/usr/bin/perl -T # obscurity through security use warnings; use strict; use CGI qw/header param escapeHTML/; my $VERSION = v0.1.5; my $revision = sprintf("version %vd", $VERSION); my $encoding = "utf-8"; my $lang = "en"; 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.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml: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>Source code</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>Nikolay Bachiyski - Info Kiosk</title> <style type="text/css"> html, body { height: 100%; margin: 0; padding: 0; border: 0; background-color: white; } 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>Nikolay Bachiyski</h1><h2> :: info kiosk</h2> </div> <div class="cell" id="about"> <h1 title="Here, in this box, you will find out the primary goal of existense of this page">What? Why?</h1> <p>Around you can find the answers of some <acronym title="Relatively Frequently Asked Questions">RFAQ</acronym> about me.</p> <p>Beyond the useful, but dull facts lives my <a href="http://nikolay.bg/" title="Go to the diary">personal diary</a>. It is a special place, where I leave the more extraordinary part of my experience and/or emotions. And the more ordinary also.</p> <p>Photos: <a href="http://flickr.com/photos/nbachiyski/">flickr</a>, <a href="http://debian.fmi.uni-sofia.bg/~nb/pure/">photolog</a></p> </div> <div class="cell" id="bio"> <h1 title="(Auto)biographical notes">Bio</h1> <dl> <dt>Birthday</dt> <dd>September 2<sup>nd</sup> 1984</dd> <dt>Middle Name</dt> <dd>Chavdarov</dd> <dt>Occupation</dt> <dd>babelfish engineer \@ <a href="http://automattic.com/">automattic</a></dd> <dt>Education</dt> <dd><a href="http://fmi.uni-sofia.bg/" title="Faculty of Mathematics and Informatics at Sofia University official website"><abbr title="Faculty of Mathematics and Informatics">FMI</abbr> at Sofia University</a>, class of 2007</dd> <dd><a href="http://www.pmgvt.org/index.php?page=en_history" title="High School of Mathematics and Natural Sciences 'Vassil Drumev' official website">HSMNS "Vassil Drumev"</a>, class of 2003</dd> </dl> </div> <div class="cell" id="emptycell"> <span title="Random fancy character on every load">$nice_char</span> </div> <div class="cell" id="contact"> <h1 title="If you wish to get in touch...">Contacts</h1> <dl> <dt>Electronic mail</dt> <dd><a title="Send me a message" href="mailto:nb\@nikolay.bg">nb\@nikolay.bg</a></dd> <dt>Address</dt> <dd>Bulgaria, Gorna Oryahovitsa, 5 Rahovets Str., Entr. B</dd> <dd>Bulgaria, Sofia, Borovo, bl. 229, apt. 71</dd> </dl> </div> </div> <div id="footer"> <ul> <li title="Nope, I am not telling you what time it was :)">&nbsp;&nbsp;Last updated on : $lastmod</li> <li title="some magic numbers...">$revision</li> <li><a href="http://validator.w3.org/check/referer" title="Check for valid XHTML">xhtml</a> <a href="http://jigsaw.w3.org/css-validator/check/referer" title="Check for valid CSS">css</a></li> <li class="last"><a href="?showsource=yes" title="View this page's source code">source code</a> </li> </ul> <a title="Although little, the content above is distributed under CC Atrribute 2.5 license" href="http://creativecommons.org/licenses/by/3.0/">Some rights reserved</a> $curryear Nikolay Bachiyski </div> </div> </body> </html> PAGE_CONTENT }