Browsed by
Month: July 2015

Apache Custom Environment Variables in PHP

Apache Custom Environment Variables in PHP

If you ever wanted to create a new Environment Variable, you can do so by setting them in the VirtualHost section.For example, And to use it in PHP simply use $_SERVER[‘VARNAME’] or getenv(‘VARNAME’);If you were to check the output of phpinfo(), you can actually see the Environment Variable as the image illustrates below.

Copy / Clone WPF User Control

Copy / Clone WPF User Control

Sometimes you need to copy/clone your user controls. I found this link very useful and hope others find it useful.In short, you create an extension method that takes type T. Using XamlWriter you save the control into xaml and then read that xaml back out as an object.Here’s the code: https://gist.github.com/jon-kim/c209cb196d54ce9b8ad703ddc265c49e