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
import React, { Component } from 'react' | |
import UserDetails from './UserDetails' | |
/** | |
* This utility function allows function calls to be debounced. | |
* @param {Function} func Function that requires debouncing | |
* @param {Number} wait Wait time in milliseconds between successive invocations | |
*/ | |
const debounce = (func, wait) => { | |
let timeout |
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
const poop = ['one', 'two', 'three', 'four', 'five'] | |
// I always use `acc` and `item` by default | |
// acc is the thing being accumulated | |
// item is each item in `poop` | |
// basic idea: this will do nothing, | |
// add some console.logs in here and study the behaviour | |
// look at the example below that uses `i` and add it here with console.log | |
const ultraBasic = poop.reduce((acc, item) => { |
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
// collect a haystack | |
const countries = [ | |
'Afghanistan', | |
'Åland Islands', | |
'Albania', | |
'Algeria', | |
'American Samoa', | |
'Andorra', | |
'Angola', | |
'Anguilla', |
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
{ | |
"Vue component": { | |
"prefix": "vue", | |
"body": [ | |
"<template>", | |
" <div></div>", | |
"</template>", | |
"", | |
"<script>", | |
"export default {", |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd" | |
bootstrap="vendor/autoload.php" | |
colors="true" | |
convertErrorsToExceptions="true" | |
convertNoticesToExceptions="true" | |
convertWarningsToExceptions="true" | |
processIsolation="false" | |
stopOnFailure="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
<?php | |
namespace Tests\Feature; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
use App\OauthProvider; | |
use App\User; | |
use Illuminate\Support\Str; | |
use Illuminate\Testing\TestResponse; | |
use Laravel\Socialite\Facades\Socialite; |
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; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
abstract class TestCase extends BaseTestCase | |
{ | |
use CreatesApplication, DatabaseTransactions; |
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; | |
use App\User; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
use Spatie\Permission\Models\Role; | |
abstract 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
<?php | |
namespace Tests; | |
use App\User; | |
use Illuminate\Foundation\Testing\DatabaseTransactions; | |
use Illuminate\Foundation\Testing\TestCase as BaseTestCase; | |
use Spatie\Permission\Models\Role; | |
abstract 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
<?php | |
use Illuminate\Auth\SessionGuard; | |
// ... | |
/** | |
* Resets AuthManager state by logging-out the user from all auth guards. | |
* This is used between unit tests to wipe cached auth state. | |
* |