Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
- No Linting
1. Search words matching | |
a. set[\s\S]*?Attribute - Searches for setHelloAttribute, setHiAttribute, etc any words starting with 'set' and 'Attributes' |
<?php | |
declare(strict_types=1); | |
namespace App\ExampleDirectory\Loggers; | |
use Monolog\Handler\HandlerInterface; | |
use Monolog\Logger as MonologLogger; | |
use Illuminate\Log\Logger; | |
use Psr\Log\LoggerInterface; |
#!/bin/sh | |
STAGED_FILES=$(git diff --cached --name-only --diff-filter=ACM | grep ".jsx\{0,1\}$") | |
if [[ "$STAGED_FILES" = "" ]]; then | |
exit 0 | |
fi | |
PASS=true |
await mongoose.connect(dbUrl, { | |
useNewUrlParser: true, | |
useUnifiedTopology: true, | |
useCreateIndex: true, | |
useFindAndModify: false, | |
}); | |
const connection = mongoose.connection; | |
connection.once("open", function() { |
Starting a personal node project could be easy; starting a team node project could be challenging.
I am a developer currently working in SEEK Australia.
In my experience, common mistakes developer make when starting a projects are:
<?php | |
/** | |
* Replicate a value | |
* | |
* @param $value | |
* @param int $times - ps: modify it to handle values less than 2 | |
* @param bool $handleClosure | |
* @return array | |
*/ |
function getSolinorUrl() | |
{ | |
$json = '{ | |
"sph-account": "test", | |
"sph-cancel-url": "http://example.test/api/cards/cancel", | |
"sph-failure-url": "http://example.test/api/cards/failure", | |
"sph-merchant": "test_merchantId", | |
"sph-request-id": "6saduyd7-648f-43ee-a65c-8sdaskd8wq", | |
"sph-success-url": "http://example.test/api/cards/success?for=5", | |
"sph-timestamp": "2019-04-02T12:31:19Z", |
<?php | |
//..... | |
if(!function_exists('freeRedirect')){ | |
function freeRedirect($to = '/'){ | |
throw new \Illuminate\Http\Exception\HttpResponseException(redirect($to)); | |
} |
<!-- See: https://jsfiddle.net/edwinencomienda/eywraw8t/444118/ --> | |
<div id="app"> | |
<form @submit.prevent="onSubmit"> | |
<input type="file" @change="onFileChange"> | |
<button>Submit</button> | |
</form> | |
</div> | |
<script> | |
new Vue({ |
$users_ids = [1,3,2]; | |
$items = collect($users_ids); | |
$fields = $items->map(function ($ids){ | |
return '?'; | |
})->implode(','); | |
$ordered = User::orderbyRaw("FIELD (id, ".$fields.")", $items->prepend('id')) | |
->find($users_ids)->pluck('id'); |