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 | |
/** | |
* sfValidatorZip validates a zip code. | |
* | |
* @author Brent Shaffer <bshafs@gmail.com> | |
*/ | |
class sfValidatorZip extends sfValidatorRegex | |
{ |
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
/* | |
* AppController.j | |
* OutlineView | |
* | |
* Created by Chandler Kent on December 7, 2009. | |
* Copyright 2009, Your Company All rights reserved. | |
*/ | |
@import <Foundation/CPObject.j> | |
@import <AppKit/CPOutlineView.j> |
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
function t(s,d,p){for(p in d)s=s.replace(new RegExp('{'+p+'}','g'),d[p]);return s;} | |
/* | |
String templating engine: | |
t("Hello {name}!, It is {date}!", { name: "Thomas", date: function(){ return new Date }}); | |
// = "Hello Thomas!, It is Sun May 08 2011 15:15:33 GMT-0400 (EDT)!" | |
*/ |
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
document.click = function(x, y) { | |
"use strict"; | |
var | |
doc = this | |
, node = doc.elementFromPoint(x, y) | |
, click = doc.createEvent("UIEvent") | |
; | |
click.initUIEvent("click", true, true, self, 1); | |
return node.dispatchEvent(click); |
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
/* | |
* create-view.js | |
* Easily create new views for accessing clean builtins, etc. | |
* | |
* 2011-10-11 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
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 | |
$watcher = new Symfony\Component\ResourceWatcher\ResourceWatcher; | |
// track any change inside directory: | |
$watcher->track('some/folder1', function($event) { | |
echo '['.$event->getType().'] '.$event->getResource()."\n" | |
}); |
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
{ | |
"require": { | |
"php": ">=5.3.2", | |
"symfony/http-kernel": "2.1-dev", | |
"symfony/routing": "2.1-dev" | |
} | |
} |
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
{ | |
"require": { | |
"behat/behat": ">=2.2.2", | |
"behat/mink": ">=1.3.2" | |
}, | |
"repositories": { | |
"behat/mink-deps": { "composer": { "url": "behat.org" } } | |
} | |
} |
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
#!/usr/bin/env php | |
<?php | |
$paths = array(); | |
if (isset($_SERVER['argv'])) | |
{ | |
$paths = $_SERVER['argv']; | |
array_shift($paths); | |
if (!$paths) |
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 | |
final class BlogPost | |
{ | |
private $created; | |
private $publish; | |
public function __construct() | |
{ | |
$this->created = new DateTime('now'); |
OlderNewer