- https://speakerdeck.com/willroth/50-laravel-tricks-in-50-minutes
- https://www.reddit.com/r/laravel/comments/3to60i/50_laravel_tricks/
- 1. Automatic Model Validation
| { | |
| "env": { | |
| "browser": true, | |
| "es2021": true | |
| }, | |
| "extends": [ | |
| "airbnb", | |
| "airbnb-typescript", | |
| "airbnb/hooks", | |
| "plugin:react/recommended", |
| import fs from 'node:fs'; | |
| export default { | |
| port: 1337, // set to match with postman | |
| dbUri: | |
| '', | |
| host: '', | |
| saltRounds: 10, | |
| accessTokenExpire: '15m', | |
| refreshTokenExpire: '2d', |
| module.exports = { | |
| printWidth: 120, // max 120 chars in line, code is easy to read | |
| useTabs: false, // use spaces instead of tabs | |
| tabWidth: 2, // "visual width" of of the "tab" | |
| trailingComma: 'es5', // add trailing commas in objects, arrays, etc. | |
| semi: true, // add ; when needed | |
| singleQuote: true, // '' for stings instead of "" | |
| bracketSpacing: true, // import { some } ... instead of import {some} ... | |
| arrowParens: 'always', // braces even for single param in arrow functions (a) => { } | |
| jsxSingleQuote: false, // "" for react props, like in html |
| { | |
| "editor.formatOnSave": true, | |
| // Format other files with prettier | |
| "editor.defaultFormatter": "esbenp.prettier-vscode", | |
| // Format ts,tsx,js,jsx with eslint | |
| "[javascript]": { | |
| "editor.defaultFormatter": "dbaeumer.vscode-eslint" | |
| }, | |
| "[javascriptreact]": { | |
| "editor.defaultFormatter": "dbaeumer.vscode-eslint" |
| // 1. Open the browser developper console on the network tab | |
| // 2. Start the video | |
| // 3. In the dev tab, locate the load of the "master.json" file, copy its full URL | |
| // 4. Run: node vimeo-downloader.js "<URL>" | |
| // 5. Combine the m4v and m4a files with mkvmerge | |
| const fs = require('fs'); | |
| const url = require('url'); | |
| const https = require('https'); |