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 | |
class FizzBuzz | |
{ | |
public function solve($start = 1, $end = 100) | |
{ | |
for($i = $start; $i <= $end; $i++) { | |
$this->print($i); | |
} |
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 Acme\Project\Model\User\Value; | |
use Acme\Project\Model\Core\Validation\Assert; | |
final class PhoneNumber | |
{ | |
/** | |
* @var string |
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 Acme\Project\Model\User\Value; | |
use Acme\Project\Model\Core\Validation\Assert; | |
final class PhoneNumber | |
{ | |
/** | |
* @var string |
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 Acme\Project\Model\User\ValueObject; | |
class UserId | |
{ | |
/** | |
* @var string | |
*/ | |
private $id; |
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
package CommandBus | |
import ( | |
"reflect" | |
"sort" | |
"sync" | |
) | |
type HandlerFunc func(cmd interface{}) |
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
// app/routes/category/index.js | |
import Ember from 'ember'; | |
import Protected from '../protected'; | |
export default Protected.extend({ | |
model: function (params) { | |
var url = this.store.adapterFor('application').getBaseUrl() + '/categories/'+ params.category + '/assets'; | |
this.controllerFor('categories').set('activeCategory', params.category); |
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
{ | |
"asset": { | |
"id": "1b0b77a2-28d7-488e-9a6f-8a202c297593", | |
"created_at": "2015-03-19T09:16:43+0500", | |
"updated_at": "2015-03-19T09:16:43+0500", | |
"name": "Flat Screen Tv", | |
"attributes": [ | |
{ | |
"name": "brand", | |
"value": "Sony", |
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
var model = [ | |
{ | |
id: 1, | |
title: "foo" | |
}, | |
{ | |
id: 2, | |
title: "bar" | |
}, | |
{ |
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
import Ember from "ember"; | |
import { module, test } from 'qunit'; | |
import startApp from '../helpers/start-app'; | |
var App; | |
module('SignIn failure', { | |
beforeEach: function() { | |
App = startApp(); | |
this.xhr = sinon.useFakeXMLHttpRequest(); |
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
var obj = { | |
some: { | |
nexted: { | |
property: "foobar" | |
} | |
} | |
}; | |
var x = Ember.get(obj, 'some.nested.property'); // i want x equal to "foobar" |