Skip to content

Instantly share code, notes, and snippets.

@komatzz
komatzz / file0.txt
Last active November 29, 2018 13:48
Vue.js で日本語の PDF を生成する ref: https://qiita.com/komatzz/items/b71167a024444f463a6b
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.39/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.39/vfs_fonts.js"></script>
@komatzz
komatzz / MailController.php
Created May 22, 2018 09:30
Laravel + SendGrid Web API でメール送信する ref: https://qiita.com/komatzz/items/7873ad6a86aedac46863
...
$sendData = [
'id' => $request->get('id'),
];
$content = new Content(
'text/plain',
strval(
view(
@komatzz
komatzz / failure.js
Last active November 17, 2017 02:01
Axios で multipart/form-data にした PUT リクエストが失敗する際の対策 ref: https://qiita.com/komatzz/items/21b58c92e14d2868ac8e
let formData = new FormData();
formData.append('picture', this.$refs.picture.files[0]);
let config = {
headers: {
'content-type': 'multipart/form-data',
},
};
@komatzz
komatzz / MailTest.php
Created October 12, 2017 09:34
Laravel でモックを使ったメール送信のテストが簡単だった ref: http://qiita.com/komatzz/items/111b71467a2f27c9bb43
class MailTest extends TestCase
{
public function testMailSend()
{
Mail::fake();
$email = 'test@gmail.com';
// 任意の実際のリクエスト処理
$this->put(
@komatzz
komatzz / file0.js
Created September 28, 2017 13:18
Vue.js でバリデーションしてメッセージを日本語化する ref: http://qiita.com/komatzz/items/c27cfec74804e6275252
import ja from 'vee-validate/dist/locale/ja';
Vue.use(VeeValidate, {
locale: 'ja',
dictionary: {
ja: {
custom: {
password: {
regex: 'パスワードは半角英数字をそれぞれ1種類以上含む8文字以上100文字以下で入力してください',
},
@komatzz
komatzz / circle.yml
Created August 8, 2017 09:41
CircleCI で php.ini の assert.exception を有効にする方法 ref: http://qiita.com/komatzz/items/40cb9cdbd54f0a173289
dependencies:
override:
- echo "assert.exception = 1" >> /opt/circleci/php/$(phpenv global)/etc/php.ini
@komatzz
komatzz / circle.yml
Last active June 20, 2017 01:05
CircleCI で yarn install が失敗したので対策を共有 ref: http://qiita.com/komatzz/items/702cb9ce870165e2ad23
machine:
php:
version: 7.1.0
node:
version: 7.10.0
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
dependencies:
override:
@komatzz
komatzz / .eslintrc.json
Created June 13, 2017 14:44
vue ファイルをリント(ESLint)する ref: http://qiita.com/komatzz/items/3cc7cc34699747efb675
{
"extends": "google",
"plugins": [
"html"
],
"env": {
"browser": true,
"es6": true
},
"parserOptions": {
@komatzz
komatzz / file0.php
Created April 24, 2017 13:57
PHP で生成したパスワードハッシュが Python でマッチするか確認 ref: http://qiita.com/komatzz/items/3da52082bec5cf681a47
password_hash('password', PASSWORD_DEFAULT);
// $2y$10$BN2hH0B3gnZceNlW1JXiNOUN8NWybLlfqZh6WQ/imah4htM8fktFW
password_hash('password', PASSWORD_BCRYPT);
// $2y$10$CuZkO0N29B1YtHHI9mwvIOCSUitQh4ptyfxYWvHhHoHHP2GZqC5Ga