View artisan_db_open.php
<?php | |
Artisan::command('db:open {connection?}', function ($connection = null) { | |
if (! file_exists('/Applications/TablePlus.app')) { | |
$this->warn('This command uses TablePlus, are you sure it\'s installed?'); | |
$this->line("Install here: https://tableplus.com/\n"); | |
} | |
$driver = $connection ?: config('database.default'); | |
$host = config("database.connections.{$driver}.host"); |
View highlighting.js
(function($) { | |
$(document).ready(function() { | |
// Highlight Navigation | |
var url = $.parseUrl(document.location); | |
$('a').each(function() { | |
var link = $.parseUrl(this.href); | |
if (link.pathname !== '' && link.pathname === url.pathname) { | |
$(this).siblings().removeClass('active'); | |
$(this).addClass('active'); | |
} |
View FooController.php
<?php | |
// src/Foobar/Controller/FooController.php | |
namespace Foobar\Controller; | |
class FooController | |
{ | |
public function helloAction($request) | |
{ |
View meta.php
<?php | |
// See: https://gist.github.com/1942528 | |
trait Call_Dynamic_Methods | |
{ | |
public function __call($name, $arguments) | |
{ | |
if (isset($this->{$name}) && $this->{$name} instanceof Closure) { | |
$this->{$name} = $this->{$name}->bindTo($this, $this); | |
return call_user_func_array($this->{$name}, $arguments); | |
} |
View example.js
// See: http://ejohn.org/blog/learning-from-twitter/ | |
(function($) { | |
$(document).ready(function() { | |
var resizeCallable = function() { | |
switch (true) | |
{ | |
case (window.innerWidth <= 768): | |
// Do some exciting device size specific magic here. | |
break; | |
} |