From dd377a5c08d82a11c0b11261a450273736a637e5 Mon Sep 17 00:00:00 2001 From: Danny Berger Date: Tue, 5 Mar 2013 16:28:27 -0700 Subject: [PATCH] tmpfilepath; tweaks to about --- about.html | 25 ++++++++-------- .../2013-02-19-using-facter-in-ant-scripts.md | 2 +- .../2013-03-05-path-based-tmpfile-in-php.md | 30 +++++++++++++++++++ 3 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 blog/_posts/2013-03-05-path-based-tmpfile-in-php.md diff --git a/about.html b/about.html index c727e69..0bfa40f 100755 --- a/about.html +++ b/about.html @@ -18,25 +18,19 @@ layout: default

I am especially familiar with 'cloud' concepts, e-commerce, server administration, and web applications. When working on a project, my preferred technologies are Unix, PHP (symfony2 lately) and JavaScript (node.js - especially). I enjoy experimenting, but I have recent production experience with the following: + especially). I enjoy experimenting, but I have recent experience with the following:

Experience

-

- Software Developer (July '09 – October '12) — Sentry Data Systems
- Developing internal applications to support business operations including a custom ticket and project management system; - defining development practices and guidelines; and implementing open source libraries for reducing internal code costs. -

-

Software Systems Engineer (June '06 – present) — The Loopy Ewe
Developing and maintaining in-house e-commerce frontend and backoffice tools; management of systems, servers, and @@ -44,11 +38,18 @@ layout: default and shipment processing with USPS and Endicia.

+

+ Software Developer (July '09 – October '12) — Sentry Data Systems
+ Guided the adoption and migration of the symfony2 framework for customer SaaS web application. Created and implemented + development tools to support software development needs. Developed internal ticket tracking system for the company to + support existing Oracle applications, email ticketing, and time estimations. +

+

Student System Administrator (Spring '06 – Fall '08) — Taylor University
Maintaining and providing support for the Computer Science department's lab computers and servers, both Linux and - Windows. Created web-based applications to aid in department processes for faculty and students. Contributing editor for - the department's public website. + Windows. Created web-based applications to aid in department processes for both faculty and students. Contributing + editor and developer for the department's public website.

diff --git a/blog/_posts/2013-02-19-using-facter-in-ant-scripts.md b/blog/_posts/2013-02-19-using-facter-in-ant-scripts.md index 379940b..1ffc534 100644 --- a/blog/_posts/2013-02-19-using-facter-in-ant-scripts.md +++ b/blog/_posts/2013-02-19-using-facter-in-ant-scripts.md @@ -54,7 +54,7 @@ And reference a fact in my task... ### Summary So now it's much easier to reference environment information from property files (via interpolation), make targets more -conditional, and, of course, from actual tasks. +conditional, and, of course, within actual tasks. [1]: https://puppetlabs.com/puppet/what-is-puppet/ diff --git a/blog/_posts/2013-03-05-path-based-tmpfile-in-php.md b/blog/_posts/2013-03-05-path-based-tmpfile-in-php.md new file mode 100644 index 0000000..c94090b --- /dev/null +++ b/blog/_posts/2013-03-05-path-based-tmpfile-in-php.md @@ -0,0 +1,30 @@ +--- +title: Path-based tmpfile in PHP +layout: post +tags: php +description: When paths are more useful than resources. +--- + +PHP has the [`tmpfile`][1] function for creating a file handle which will automatically be destroyed when it is closed +or when the script ends. PHP also has the [`tempnam`][2] function which takes care of creating the file and returning +the path, but doesn't automatically destroy the file. + +To get the best of both worlds (temp file + auto-destroy), I have found this useful: + +{% highlight php startinline %} +function tmpfilepath() { + $path = stream_get_meta_data(tmpfile())['uri']; + + register_shutdown_function( + function () use ($path) { + unlink($path); + } + ); + + return $path; +} +{% endhighlight %} + + + [1]: http://php.net/manual/en/function.tmpfile.php + [2]: http://php.net/manual/en/function.tempnam.php