This file contains hidden or 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\Traits; | |
| use Rhumsaa\Uuid\Uuid; | |
| use Illuminate\Database\Eloquent\ModelNotFoundException; | |
| /** | |
| * Trait UuidModel | |
| * @package App\Traits |
This file contains hidden or 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 GuzzleHttp\Client; | |
| // use Cache; | |
| // 86400 = 1 day // 604800 = 1 week | |
| $feed = Cache::remember('rr-blog', 86400, function() | |
| { | |
| $client = new Client([ | |
| 'base_uri' => 'https://blog.raceroster.com/', |
This file contains hidden or 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 | |
| ////////////////////////////////// | |
| // Reddit "hot" story algorithm // | |
| ////////////////////////////////// | |
| function hot($ups, $downs, $date) | |
| { | |
| if (is_string($date)) $date = strtotime($date); | |
| $s = $ups - $downs; |