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\Presenters; | |
use Illuminate\Support\Collection; | |
abstract class Presenter { | |
protected $resource; | |
public function __construct($resource) | |
{ |
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 BaseController extends Controller { | |
/** | |
* Setup the layout used by the controller. | |
* | |
* @return void | |
*/ | |
protected function setupLayout() |
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 | |
App::before(function($request) { | |
if ($request->getMethod() == 'OPTIONS') { | |
$response = Response::make('', 204); | |
$response->header('Access-Control-Allow-Methods', 'GET, POST, PUT, OPTIONS'); | |
$response->header('Access-Control-Allow-Origin', '*'); | |
$response->header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept, Authorization'); | |
return $response; | |
} |
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 | |
// bootstrap/start.php | |
/* | |
|-------------------------------------------------------------------------- | |
| Detect The Application Environment | |
|-------------------------------------------------------------------------- | |
| | |
| Laravel takes a dead simple approach to your application environments |
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 | |
// Our test | |
$songs = M::mock('SongCollection'); | |
$songs->shouldReceive('sum') | |
->with('length') | |
->andReturn(500); | |
$album->songs = $songs; |
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 | |
// app/config/testing/database.php | |
return [ | |
'default' => 'sqlite', | |
'connections' => [ | |
'sqlite' => [ | |
'driver' => 'sqlite', | |
'database' => ':memory:', | |
'prefix' => '', |
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
testtttt |
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
.episode { | |
margin-bottom: 5em; | |
&-header { | |
&-title { | |
margin-top: 0; | |
margin-bottom: (@line-height-computed / 4); | |
font-size: @font-size-h4; | |
} | |
&-meta { | |
margin-top: 0; |
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 scublish() { | |
sculpin generate --env=prod | |
cd output_prod | |
git add --all | |
git commit -am "$1" | |
git push origin master | |
cd .. | |
} |
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 | |
// Wow this whole thing is horrible | |
class Struct | |
{ | |
public function __construct($properties) | |
{ | |
foreach ($properties as $key => $value) { | |
if (property_exists($this, $key)) { | |
$this->{$key} = $value; |
OlderNewer