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
Route::get('/{series_slug}/{episode_number}', function($series_slug, $episode_number){ | |
// $episode = \App\Episode::visible()->where('number', '=', $episode_number)->series; | |
// $episode = \App\Episode::visible()->has('series', '=', $series_slug); | |
// $episode = \App\Episode::has('series', '=', $series_slug)->get(); | |
$episode = \App\Episode::visible()->whereHas('series', function($q) use ($series_slug) {$q->where('slug', '=', $series_slug);})->where('number', '=', $episode_number)->first(); | |
return $episode; | |
}); |
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
public function scopeVisible($query) { | |
return $query | |
->where('hidden', '=', false) | |
->where('state', '=', 'published'); | |
} | |
public function scopeAccessible($query) { | |
return $query | |
->where('hidden', '=', false) |
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
Route::get('/{series_slug}/feed/fringe/', function($series_slug){ | |
$series = \App\Series::visible() | |
->where('slug', '=', $series_slug) | |
->firstOrFail(); | |
$episodes = \App\Episode | |
::with(['related']) | |
->visible() | |
->recent() | |
->withSlug($series_slug) |
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 App; | |
use Illuminate\Database\Eloquent\Model; | |
class Episode extends Model { | |
protected $hidden = ['content']; | |
/* Relationships */ | |
public function related() { |
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 | |
require 'vendor/autoload.php'; | |
/* | |
Using https://github.com/thephpleague/color-extractor | |
for library | |
http://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color | |
for brightness text | |
*/ |
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
let_exp: | |
LET declarations IN sequence_list END (A.LetExp { | |
decs = declarations, | |
body = A.SeqExp(sequence_list), | |
pos = LETleft}) | |
LET declarations IN sequence_list END (A.LetExp { | |
desc = declarations, | |
body = A.SeqExp(sequence_list), | |
pos = LETleft}) |
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 | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Database\Migrations\Migration; | |
class CreateSeriesTable extends Migration { | |
/** | |
* Run the migrations. | |
* |
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 App\Http\Controllers\Admin; | |
use App\Http\Controllers\Controller; | |
use Illuminate\Http\Request; | |
// use Request; | |
class SeriesController extends Controller { | |
/** | |
* Create a new controller instance. |
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
@Override | |
public boolean equals(Object obj) { | |
if (this == obj) | |
return true; | |
if (obj == null) | |
return false; | |
if (getClass() != obj.getClass()) | |
return false; | |
Course other = (Course) obj; | |
if (credits != other.credits) |
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
val params' = map (fn ({name, escape, typ, pos}) => ( | |
(case Symbol.look(tenv, typ) of | |
SOME(t) => t | |
| NONE => (report pos (E.UndeclaredType (Symbol.name name)) "undeclared type in function params"; E.ERROR) | |
) | |
)) params |