Skip to content

Instantly share code, notes, and snippets.

View Tynael's full-sized avatar
🎯
Focusing

Carol Pelu Tynael

🎯
Focusing
View GitHub Profile
@Tynael
Tynael / \app\Http\Requests\CreateUserRequest.php
Created October 26, 2023 18:49
Laravel — Improve Email Validation
<?php
declare(strict_types=1);
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class CreateUserRequest extends FormRequest
{
@Tynael
Tynael / keybindings.json
Created October 11, 2023 07:56
VS Code: Switch between Editor & Terminal
[
{
"key": "ctrl+down",
"command": "workbench.action.terminal.focus",
},
{
"key": "ctrl+up",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
}
@Tynael
Tynael / index.php
Last active October 9, 2023 19:51
Test PostgreSQL default connection with PHP
<?php
var_dump(
pg_connect("
host=localhost
port=5432
dbname=postgres
user=postgres
password=root
")
@Tynael
Tynael / index.js
Created August 17, 2023 17:08
Detect User's Browser and Operating System Using JavaScript
navigator.userAgentData
// Returns
{
"brands": [
{
"brand": "Chromium",
"version": "116"
},
{
@Tynael
Tynael / index.js
Created August 17, 2023 16:56
Deprecated ways of getting data about user's browser and operating system
navigator.appVersion
// '5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'
navigator.platform
// 'Win32'
navigator.userAgent
// 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36'
@Tynael
Tynael / index.html
Created August 1, 2023 15:36
How to Change Favicon on Tab Switch Using JavaScript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Website</title>
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
@Tynael
Tynael / git.bash
Created July 27, 2023 12:59
Autocorrect Git Commands
$ git sttus
WARNING: You called a Git command named 'sttus', which does not exist.
Run 'status' instead [y/N]?
@Tynael
Tynael / git.bash
Created July 27, 2023 12:50
Autocorrect Git Commands
$ git com -m "Work work"
git: 'com' is not a git command. See 'git --help'.
The most similar commands are
commit
column
@Tynael
Tynael / git.bash
Created July 27, 2023 12:48
Autocorrect Git Commands
$ git sttus
WARNING: You called a Git command named 'sttus', which does not exist.
Continuing under the assumption that you meant 'status'.
On branch master
Your branch is up to date with 'origin/master'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: app/Http/Controllers/ProfileController.php
@Tynael
Tynael / git.bash
Last active July 27, 2023 13:40
Autocorrect Git Commands
$ git chek
git: 'chek' is not a git command. See 'git --help'.
The most similar commands are
checkout
cherry