Skip to content

Instantly share code, notes, and snippets.

@regepan
regepan / nodenv.md
Last active September 15, 2021 17:39

Migration

# Remove all data
$ php artisan migrate:fresh --seed
$ php artisan migrate
# Update table
$ php artisan make:migration add_votes_to_users_table --table=users
var hoge1;
var hoge2 = 1;

console.log("hoge1 =", typeof hoge1, typeof hoge1 === 'undefined'); // hoge1 = undefined true
console.log("hoge2 =", typeof hoge2, typeof hoge2 === 'undefined'); // hoge2 = number false
console.log("hoge3 =", typeof hoge3, typeof hoge3 === 'undefined'); // hoge3 = undefined true
@regepan
regepan / wp-cli.md
Last active February 13, 2021 19:56

WP-CLI snippets

$ wp option get siteurl && wp option get home
/**
 *
 *
---------------------------------------------------------*/
function isPost() {
    return $_SERVER['REQUEST_METHOD'] === 'POST';
}
$ php -r 'echo 1;'

How to introduce mailcatcher for PHP project?

just follow official site instruction.
https://mailcatcher.me/

just copy-paste below line in php.ini

sendmail_path = /usr/bin/env catchmail -f [email protected]
console.log(`EVENT: ${e.type}`);

// EVENT: canplay

This command on Mac Terminal.app is better than Finder copy paste.

$ cp -r from/ to/
// Load webfont file via js
// Use .wf-active to avoid FOIT, FOUT.
// * FOIT (Flash of Invisible Text)
// * FOUT (Flash of Unstyled Text)
//----------------------------------------------
html {
&.wf-active {
body {