Manually register a user in Laravel (Tinker)
User::create([
'email' => '[email protected]',
'name' => 'Alex',
'password' => bcrypt('password')
])Update a product if the amount is upper to 0
| <?php | |
| if (! function_exists('list_models')) { | |
| /** | |
| * Return a list of existing app models. | |
| * | |
| * @return array | |
| */ | |
| function list_models(): array | |
| { |
Manually register a user in Laravel (Tinker)
User::create([
'email' => '[email protected]',
'name' => 'Alex',
'password' => bcrypt('password')
])Update a product if the amount is upper to 0
| // Remove any duplicates from an array of primitives. | |
| const unique = [...new Set(arr)] | |
| // Sleep in async functions. Use: await sleep(2000). | |
| const sleep = ms => (new Promise(resolve => setTimeout(resolve, ms)) | |
| // Type this in your code to break chrome debugger in that line (breakpoint). | |
| debugger | |
| // Just plain english. |
| from random import sample | |
| from string import ascii_letters, digits | |
| def generate_password(length): | |
| return ''.join(sample(ascii_letters + digits, length)) | |
| print(generate_password(10)) |
| 100.42 .toLocaleString('en-US', { style: 'currency', currency: 'USD' }) | |
| 100.42 .toLocaleString('fr-FR', { style: 'currency', currency: 'EUR' }) | |
| 100.42 .toLocaleString('ja-JP', { style: 'currency', currency: 'YEN' }) |
| root = true | |
| [*] | |
| charset = utf-8 | |
| end_of_line = lf | |
| insert_final_newline = true | |
| indent_style = space | |
| indent_size = 4 | |
| trim_trailing_whitespace = true |
| const { src, dest, watch, series } = require('gulp') | |
| const pug = require('gulp-pug') | |
| const sass = require('gulp-sass') | |
| const browserSync = require('browser-sync').create() | |
| // Compile pug files into HTML | |
| function html() { |