Software Developer. Computer Geek. INTJ.

Month July 2012

Magpie Eating Bread

Christ Church College, Oxford

Birds in the Garden

Experimenting with my new DSLR

Olympic Torch, Oxford

Fully restart Ruby on Rails app under Phusion Passenger during Capistrano (cap) deploy

Most instructions for using Capistrano tell you how to make it restart Phusion Passenger by touching the restart.txt file, but this doesn’t immediately restart the app – instead the first person to try to use the application will cause it to be…

Zip a dynamically generated file in PHP

// Generate the contents of the file somehow $content = ‘…’; // Zip the file $zipFile = tempnam(sys_get_temp_dir(), ‘zipfile’); $zip = new ZipArchive; $zip->open($zipFile, ZipArchive::OVERWRITE); $zip->addFromString(‘sample.txt’, $content); $zip->close(); // Do something with the file (e.g. attach it to an email)…

© 2021 Dave James Miller — Powered by WordPress

Theme by Anders NorenUp ↑