Skip to content

Instantly share code, notes, and snippets.

View assertchris's full-sized avatar

Christopher Pitt assertchris

View GitHub Profile
<?php
@foreach (array_chunk($images->toArray(), 4) as $chunk)
<tr>
@foreach($chunk as $image)
<td><img src="{{ $image["url"] }}"></td>
@endforeach
</tr>
@endforeach
@assertchris
assertchris / gist:9728147
Created March 23, 2014 19:11
Ah, namespace resolution.
<?php
namespace Tricks\Services\Upload;
use Mockery;
use TestCase;
$headers = [];
function header($value) {
<?php
namespace Tricks\Providers;
use Tricks\Services\Social\Disqus;
use Tricks\Services\Social\Github;
use Illuminate\Support\ServiceProvider;
use Guzzle\Service\Client as GuzzleClient;
use League\OAuth2\Client\Provider\Github as GithubProvider;
<?php
namespace Tricks\Providers;
use App;
use Mockery;
use TestCase;
class NavigationServiceProviderTest
extends TestCase
<?php
namespace Tricks\Providers;
use Illuminate\Support\ServiceProvider;
use Tricks\Services\Navigation\Builder;
class NavigationServiceProvider extends ServiceProvider
{
/**
<?php
namespace Formativ\Theme;
use Illuminate\Foundation\Application;
use Illuminate\Routing\Router;
use Illuminate\Support\ServiceProvider;
class ThemeServiceProvider
extends ServiceProvider
<?php
// https://github.com/teepluss/laravel4-theme/blob/master/src/Teepluss/Theme/Theme.php#L714-L750
class IndexController
extends BaseController
{
public function indexAction()
{
$foo = "bar";
<?php
$env = $app->detectEnvironment(function() {
// detect environment here
return "local";
});
https://laracasts.com/search?q=polymorphic
https://laracasts.com/search?q=relationships
http://codeplanet.io/laravel-model-relationships-pt-1
/**
* @jsx React.DOM
*/
define(["react"], function(React) {
return React.createClass({
"render" : function() {
return <div className={(this.props.className || "") + " container"}>{this.props.children}</div>;
}