Posts tagged with programming - page 2

Multiple Twig Template Folders with Slim Framework

This post is more for my own records than anything else as I couldn't find this information anywhere on the internet.

I have a Slim Framework application that uses Twig for it's templates. I wanted to initiate the Twig instance in my bootstrap file, but then to dynamically update the template directory within my class files depending on the request. It took me a while to figure out how to set Slim to look in multiple directories, or to change the template directory altogether, to render a view.

Read More

XKCD's "Now" Coded in JavaScript

I love XKCD's web comics, they always give you a new way of looking at something and a laugh to boot. Yesterday at work I came accross the Now comic. It shows you at a glance what countries are in business hours, or outside them. The image is rendered on the XKCD server and updated every hour when you refresh your page.

Read More

Setup Mass Dynamic Virtual Hosts on Nginx

Apache has a handy feature that allows you to dynamically serve a domain without having to create a virtualhost for each time, called Dynamic Virtual Hosts. Nginx doesn't have this feature built in, but it does gives you the tools you need to to set it up in no time. Here is a guide to how I got it working on my server after I transitioned my site from Apache to Nginx.

Read More