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
/* Helper buddy for removing async/await try/catch litter 🗑 */ | |
function O_o(promise) { | |
return promise.then(data => { | |
if (data instanceof Error) return [data] | |
return [null, data] | |
}).catch(err => [err]) | |
} | |
/* Look ma, no try/catch */ | |
async function usageExample(params) { |
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 Tests\Api; | |
use App\User; | |
use Tests\TestCase as BaseTestCase; | |
use Illuminate\Contracts\Auth\Authenticatable as UserContract; | |
class TestCase extends BaseTestCase | |
{ |
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
Total props to Brian Cray: http://briancray.com/posts/estimated-reading-time-web-design/ |