Posts from: 2012

21 Apr

For the 4-20 folks

Another year it still deserves saying… It’s long been clear the risks and harms of cannabis use are mild, and with that knowledge it should sicken us that people are regularly pulled into our criminal justice system because of cannabis use, sales, production, or political speech (see the example made of Marc Emery). Shame on [...]

16 Apr

Define namespace constants using expressions

Since const is parsed at compile-time, you can’t use expressions in namespace constants, but you can use define as long as the name argument is the full name from the global scope (run this): namespace Foo\Bar; const CONST1 = 1; define(‘CONST2′, 1 + 1); // global define(__NAMESPACE__ . ‘\\CONST3′, 1 + 1 + 1); // [...]

15 Apr

PHP RFC Preview: Dynamic Callback Expressions

I’m posting this to get some initial feedback on this idea before I officially submit an RFC. Background Even with PHP’s growing object oriented and functional programming features, the callback remains a widely-used feature. However, forcing authors to create callbacks via strings and arrays presents difficulties: IDEs cannot recognize callbacks and so cannot offer autocompletion, [...]

22 Jan

Convert Google Maps embed HTML to Street View URL

You can use the form below to convert the HTML embed code Google Maps gives you to a usable Street View URL loading… Why do I need this? The new Google Maps layout has a chain-link icon on the left that gives you a URL to what you’re looking at. If you’re in Street View, sometimes [...]