This file contains hidden or 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
define("DateWithTimezone", function(module) { | |
var DateWithTimezone = function(moment){ | |
this.moment = moment | |
moment.tz(DateWithTimezone.getTimezone()) | |
} | |
_.extend(DateWithTimezone.prototype, { | |
toISO: function(){ | |
return this.format() | |
}, |
This file contains hidden or 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 | |
trait EventGenerator | |
{ | |
protected $pendingEvents = array(); | |
protected function raise($event) | |
{ | |
$this->pendingEvents[] = $event; | |
} |
This file contains hidden or 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 | |
class PostEntity | |
{ | |
private $id; | |
private $user; | |
private $title; | |
private $content; | |
private $date; | |
This file contains hidden or 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
from django.contrib.sites.models import Site | |
class Object(object): | |
def __init__(self, model, key): | |
self.model = model | |
self.key = key | |
def __call__(self, *args, **kwargs): | |
params = {} |
This file contains hidden or 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
projectname/ | |
README.md | |
.gitignore | |
bower.json | |
package.json | |
node_modules/ | |
bower_components/ | |
bin/ | |
script1 | |
script2 |
This file contains hidden or 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
var HEADER_NAME = 'MyApp-Handle-Errors-Generically'; | |
var specificallyHandleInProgress = false; | |
angular.module('myApp').factory('RequestsErrorHandler', ['$q', function($q) { | |
return { | |
// --- The user's API for claiming responsiblity for requests --- | |
specificallyHandled: function(specificallyHandledBlock) { | |
specificallyHandleInProgress = true; | |
try { | |
return specificallyHandledBlock(); |
This file contains hidden or 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
var util = require('util'); | |
it('should upload file', function() { | |
var fileToUpload = '../some/path/foo.txt'; | |
var absolutePath = path.resolve(__dirname, fileToUpload); | |
$('input[type="file"]').sendKeys(absolutePath); | |
$('#uploadButton').click(); | |
}); |
This file contains hidden or 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
/** | |
* Interceptor | |
* Implements functionality to catch various requests and fire events when they happen. This is generally to ensure | |
* that responses from the server are handled in a uniform fashion across the application. Also, by firing events | |
* it allows to have any number of handlers attach to the response. | |
* | |
* @author Kirk Bushell | |
* @date 28th March 2013 | |
*/ | |
var module = angular.module('core.interceptor', []); |
This file contains hidden or 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
## Customized for Laravel 4 | |
# setting worker_processes to CPU core count | |
worker_processes 1; | |
daemon off; | |
events { | |
worker_connections 1024; | |
} |
This file contains hidden or 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
## Customized for Laravel 4 | |
# setting worker_processes to CPU core count | |
worker_processes 1; | |
daemon off; | |
events { | |
worker_connections 1024; | |
} |