PHPNews

The Many Faces of Ruby Callables

One of the most valuable ideas from functional programming is the idea of Higher Order Functions , or functions that take functions as an argument. It is such a good idea that it has become part of pretty much every modern language, whether functional or not. Amoung the OO imperative languages that have embraced this …

Continue reading »

Written by Matt Briggs - - Aggregated on Saturday May 5, 2012


Awesome Emacs Plugins: CTags

I wanted to write a series of posts on awesome emacs plugins I use, since I have put a lot of time and effort into my emacs configs . The funny thing I find about emacs though is that there is such a massive amount of functionality already provided, most neat things plugins do is augment stuff that is already there. …

Continue reading »

Written by Matt Briggs - - Aggregated on Sunday March 18, 2012


Why I like Object#tap

In a recent Destroy All Software screencast, Gary mentioned how he really doesn’t like Object#tap . He was using it in this sort of context 1 2 3 4 5 6 7 8 9 10 class StoreCache def self.for_term(term) begin CachedScore.for_term(term) rescue CachedScore::NoScore RockScore.for_term(term).t…

Continue reading »

Written by Matt Briggs - - Aggregated on Thursday March 8, 2012


Awesome Emacs Plugins: Evil Mode

I want to do a series of posts on some of the cool emacs plugins I use. Before I do that though, I want to talk a bit about why I use and love emacs. The saying “Care about the code, not the tools” is an anathama to me, it is like “Care about breathing, but don’t worry about drinking”. Breathing is incredibly …

Continue reading »

Written by Matt Briggs - - Aggregated on Monday February 27, 2012


Repository Pattern In Rails

I have been working a lot on an app using MongoDB as the datastore, and Mongoid as the OR/M (or ODM to be more specific). In a relational database, you keep your data as segregated as reasonably possible, and then join it together in appropriate ways when you need it. The up side to this is that it is incredibly …

Continue reading »

Written by Matt Briggs - - Aggregated on Thursday February 23, 2012


Concatenation is not a parser error

CSI: PHP isn’t big on the perp walk , but if your crime is (1) public and (2) licensed with an Attribution-NonCommercial-ShareAlike Creative Commons license, then you kinda perp walked yourself . 1 2 3 4 5 6 7 8 9 <?php // What will this print out in php5? $earth = 'World'; $string1 = "Hello " …

Continue reading »

Written by CSI: PHP - - Aggregated on Thursday February 23, 2012


The Interview

Yes, this really happened. Q: How long have you been working with PHP? A: About 8 years. Q: On a scale of 1 – 10, how would you rate your proficiency with PHP? A: I’d say I’m an expert. Q: Can you tell me the difference between an abstract class and an interface , and when you might use either? …

Continue reading »

Written by CSI: PHP - - Aggregated on Thursday February 9, 2012


For your consideration

This was sent along anonymously, along with the question: “Does this count as horror code or pure evil genius code?” What say you, dear reader? I cut and paste, you decide. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 <?php function cli_parsestr($string, $config, $mainconf, …

Continue reading »

Written by CSI: PHP - - Aggregated on Friday February 3, 2012


Chunked Transfer-Encoding in PHP with Guzzle

The problem with Content-Length HTTP/1.0 requires a client to specify a Content-Length header before sending a request to a server. This means that requests can not be sent with a dynamically created entity body until the entire length of the entity body is known. A lot of HTTP clients that support HTTP/1.1 still …

Continue reading »

Written by unknown - - Aggregated on Friday January 27, 2012


What's new in Guzzle 2.1

There were some major improvements added to Guzzle in the last week. Guzzle is now more flexible, easy to use, and more powerful than ever. Here’s a list of the major features introduced in the 2.x series: Guzzle now uses the Symfony2 EventDispatcher component Guzzle now uses the Symfony2 Validator …

Continue reading »

Written by unknown - - Aggregated on Tuesday January 24, 2012


How Diaspora Connects Users

Note: this is the first in a series of technical posts about Diaspora’s software architecture and code, and is a slightly modified version of the original on the Diaspora blog . If you have topics you’d like to see covered in future installments, please let me know. A single installation of the Diaspora software …

Continue reading »

Written by Sarah Mei - - Aggregated on Saturday September 17, 2011