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
<?php | |
/** | |
* A simple function that uses mtime to delete files older than a given age (in seconds) | |
* Very handy to rotate backup or log files, for example... | |
* | |
* $dir String whhere the files are | |
* $max_age Int in seconds | |
* return String[] the list of deleted files | |
*/ |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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)); | |
} |