In this short write-up, I will briefly summarize the types of modeling I have seen and attempted over the years, highlighting some of the advantages and drawbacks of each, ending with a conclusion explaining which one I prefer and why.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* jQuery wrapper/plugin for console functions in FF/IE/Chrome. | |
* | |
* These functions execute silently when no console is available, so | |
* you can safely leave diagnotics calls in place during development | |
* and beta-testing. | |
* | |
* Examples: | |
* | |
* $.log('Hello, World.',1,2,3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Sample implementation of a FilterInterface apadater for Conduit (UNTESTED) | |
use Phly\Conduit\MiddlewareInterface; | |
use Psr\Http\Message\ServerRequestInterface as Request; | |
use Psr\Http\Message\ResponseInterface as Response; | |
use Psr\Http\Message\FilterInterface as Filter; | |
class ConduitFilterAdapter implements MiddlewareInterface |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use mindplay\walkway\Route; | |
use Phly\Conduit\MiddlewareInterface; | |
use Phly\Conduit\MiddlewarePipe; | |
use Phly\Http\Server; | |
use Psr\Http\Message\ServerRequestInterface as Request; | |
use Psr\Http\Message\ResponseInterface as Response; | |
require __DIR__ . '/vendor/autoload.php'; |
Example LESS file:
.layout {
.row();
background: #ddd;
}
.nav {
.col(4);
jQuery plugin to replace checkboxes with <div>
elements for styling.
This plugin makes no assumptions about class-names or the contents of the <div>
element,
it only implements the behavior - it returns the generated <div>
elements for further
operations with jQuery functions, so you can do for example:
$('input[type=checkbox]')
.checkbox() // returns set of <div> elements
.addClass('checkbox') // adds class="checkbox" to every <div> element
.html('✔') // inserts a unicode checkmark into every element
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// basic GitHub service hook example | |
$payload = file_get_contents("php://input"); | |
$secret_key = 'secret'; | |
$computed_signature = 'sha1=' . hash_hmac('sha1', $payload, $secret_key, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Map php errors to the built-in ErrorException class. | |
* | |
* Respects the error_reporting() setting and the error-suppression operator. | |
* | |
* @see ErrorException | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Psr\Cache; | |
/** | |
* Cache defines a common driver interface for interacting with a cache back-end. | |
*/ | |
interface Driver | |
{ | |
/** |