Skip to content

Instantly share code, notes, and snippets.

View ucan-lab's full-sized avatar

ucan-lab ucan-lab

View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGmCwwXHR4lVSRudWxs1Q0ODxAR
EhMUFRZcTlNDb21wb25lbnRzVU5TUkdCXE5TQ29sb3JTcGFjZV8QEk5TQ3VzdG9tQ29s
b3JTcGFjZVYkY2xhc3NPECcwLjQ0MTk5MDg4MjIgMC42NTA5NzU4ODMgMC44MjE3MjM0
@ucan-lab
ucan-lab / cakephp-security-salt-generator.php
Last active June 16, 2020 16:35
CakePHP4 SECURITY_SALT generator
<?php declare(strict_types=1);
final class CakePHPSecuritySaltGenerator
{
/**
* @return string
*/
public function generate(): string
{
return uniqid(bin2hex(random_bytes(32)));
@ucan-lab
ucan-lab / file0.sh
Last active July 15, 2018 00:55
HerokuのPostgreSQLにログインしてSQLを直接実行する。 ref: https://qiita.com/ucan-lab/items/fb74af3d78e71407db7b
$ heroku pg:psql
--> Connecting to postgresql-nipple-114514
▸ The local psql command could not be located. For help installing psql, see
▸ https://devcenter.heroku.com/articles/heroku-postgresql#local-setup
@ucan-lab
ucan-lab / file0.txt
Last active November 9, 2018 06:01
Mixed-Nuts モダンなWebサイト制作環境を爆速で構築する ref: https://qiita.com/ucan-lab/items/38c6e625967796b8afb7
$ git clone https://github.com/ucan-lab/mixed-nuts ./example
$ cd example
$ npm install
@ucan-lab
ucan-lab / file0.txt
Created June 9, 2018 09:14
CentOS7 に wkhtmltopdf をインストールする ref: https://qiita.com/ucan-lab/items/5ba8c8fac4407239f19f
$ sudo yum -y install libXrender libXext
@ucan-lab
ucan-lab / file0.txt
Last active May 31, 2018 00:03
Laravel5 MySQL8.0 NO_AUTO_CREATE_USERのSQL_MODEエラー対策 ref: https://qiita.com/ucan-lab/items/2a482a9537dcc5daeb97
$ php artisan migrate
In Connection.php line 664:
SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER' (SQL: sel
ect * from information_schema.tables where table_schema = microposts and table_name = migrations)
In MySqlConnector.php line 150:
SQLSTATE[42000]: Syntax error or access violation: 1231 Variable 'sql_mode' can't be set to the value of 'NO_AUTO_CREATE_USER'
@ucan-lab
ucan-lab / file0.txt
Last active April 12, 2020 14:16
MySQL8.0 認証方式を変更する(Laravel5) ref: https://qiita.com/ucan-lab/items/3ae911b7e13287a5b917
$ php artisan migrate
Illuminate\Database\QueryException : SQLSTATE[HY000] [2054] The server requested authentication method unknownto the client (SQL: select * from information_schema.tables where table_schema = blog and table_name = migrations)
at /home/vagrant/blog/vendor/laravel/framework/src/Illuminate/Database/Connection.php:664
660| // If an exception occurs when attempting to run a query, we'll format the error
661| // message to include the bindings with SQL, which will make this exception a
662| // lot more helpful to the developer instead of just the database's errors.
663| catch (Exception $e) {
> 664| throw new QueryException(
665| $query, $this->prepareBindings($bindings), $e
@ucan-lab
ucan-lab / file0.txt
Last active February 6, 2019 13:13
Laravelの開発環境をVagrantを使って構築する ref: https://qiita.com/ucan-lab/items/e4a268e9f227ed6294b4
git clone https://github.com/ucan-lab/vagrant-laravel5
cd vagrant-laravel5
cp Vagrantfile.example Vagrantfile
vagrant up
@ucan-lab
ucan-lab / file0.txt
Created May 22, 2018 10:30
Vagnrat Ubuntu16.04 apt upgrade のGRUBで更新が止まる時の対策 ref: https://qiita.com/ucan-lab/items/1608b4140ac0b1797144
$ vagrant init -m bento/ubuntu-16.04
$ vagrant up
$ vagrant ssh
$ sudo su -
@ucan-lab
ucan-lab / file0.html
Last active December 27, 2019 03:20
jQuery フォームボタンに応じて遷移先を変更する。 ref: https://qiita.com/ucan-lab/items/09d3fe885778642d9456
<form>
<button type="submit" class="change-action" data-action="/" data-method="GET">一覧へ</button>
<a href="javascript:void(0)" class="change-action" data-action="/update/1" data-method="PUT">更新</a>
<button type="submit" class="change-action" data-action="/images" data-method="POST" data-enctype="multipart/form-data">ファイルアップロード</button>
<button type="submit" class="change-action" data-action="/images/1" data-method="DELETE">画像削除</button>
</form>