Niko's Project Corner

PHP at other sites

Anonymous and secure information storing and sharing

(25th April 2015)

Nowa­days en­cryp­tion is stan­dard prac­tice on web when data is in tran­si­tion, and there are even a few ser­vices which of­fer client-side en­cryp­tion and thus are truly end-to-end. Nev­er­the­less for some rea­son they all re­quire you to cre­ate and ac­count by pro­vid­ing your email and pass­word, al­though this is not strictly nec­es­sary for stor­ing and shar­ing data. In this sys­tem the doc­ument id, en­cryp­tion key and HMAC key are gen­er­ated ad-hoc on the client and only min­imal nec­es­sary in­for­ma­tion is re­vealed to the server. A live demo should be avail­able at no­knowl­

Languages: PHP
Tags: GitHub Encryption
GitHub: nikonyrh/noknowledgenotes

Automated image capturing + API

(10th April 2015)

Out of in­ter­est on na­ture ob­ser­va­tion, com­puter vi­sion, im­age pro­cess­ing and so forth I de­vel­oped an au­to­mated sys­tem to cap­ture one photo / min­ute and store it on a disk. The pro­ject also has Bash and PHP scripts co­or­di­nat­ing ex­ter­nal tools such as mon­tage for im­age stitch­ing and men­coder for video gen­er­ation. PHP also pro­vides an HTTP API for im­age gen­er­ation and file size statis­tics.

Languages: Bash PHP
Tags: GitHub
GitHub: nikonyrh/webcammon

Server monitoring and analytics

(26th April 2014)

There al­ready ex­ists many server mon­itor­ing and log­ging sys­tems, but I was in­ter­ested to de­velop and de­ploy my own. It was also a good chance to learn about Elas­tic­Search's ag­gre­ga­tion queries (new in v1.0.0). Orig­inally Elas­tic­Search was de­signed to provide scal­able doc­ument based stor­age and ef­fi­cient search, but now it is gain­ing more ca­pa­bil­ities. The pro­ject con­sists of a cron job which pushes new met­rics to Elas­tic­Search, a REST­ful JSON API to query statis­tics on recorded num­bers and plot the re­sults in a browser (based on High­Charts).

Languages: PHP
Tags: Elasticsearch Databases

Automatic file maneger in PHP

(14th July 2013)

I got tired of man­ually or­ga­niz­ing my down­loads folder, and af­ter not be­ing happy with ex­ist­ing so­lu­tions I de­cided to write a PHP script which would en­able me to eas­ily con­fig­ure new rules for file and folder man­age­ment. This is achieved by hav­ing a flex­ible class hi­er­ar­chy, so that you don't end up re­peat­ing your­self when con­fig­ur­ing new rules and ac­tions.

Languages: PHP
Tags: Regular Expressions

English hyphenation algorithm in PHP

(10th July 2013)

A good pre­sen­ta­tion about hy­phen­ation in HTML doc­uments can be seen here, but it is client side (JavaScript) ori­ented. Ba­si­cally you shouldn't use jus­ti­fied text un­less it is hy­phen­ated, be­cause long words will cause huge spaces be­tween words to make the line stretch out the whole width of the el­ement. I found a few PHP scripts such as ph­pHy­phen­ator 1.5, but typ­ically they weren't im­ple­mented as a sin­gle stand-alone PHP class. Since the un­der­ly­ing al­go­rithm is fairly sim­ple, I de­cided to write it from scratch.

Languages: PHP
Tags: Hyphenation Blog GitHub
GitHub: nikonyrh/hyphenator-php

Blogging platform — What Would TeX Do?

(6th July 2013)

I wrote this blog en­gine to en­able the cre­ation of new ar­ti­cles in LaTeX for­mat and ef­fort­lessly pub­lish them in Web. As a by-pro­duct it en­ables triv­ial PDF gen­er­ation of each ar­ti­cle, or even a com­bined PDF with all the ar­ti­cles con­cate­nated with a in­ter­ac­tive table of con­tents, au­to­mat­ically nu­mer­ated fig­ures with ref­er­ences from the text, and many other fea­tures that LaTeX users take for granted.

Languages: PHP LaTeX Mustache
Tags: Blog Git