Skip to content

Instantly share code, notes, and snippets.

View ogaty's full-sized avatar

Yuji Ogata ogaty

View GitHub Profile
@ogaty
ogaty / application.md
Last active July 26, 2023 04:52
イケてるアプリ application tools service web
@ogaty
ogaty / visualstudio.md
Last active July 22, 2023 01:19
キーバインドVisualStudio統一計画 keyboard key binding

キーバインド統一計画

個人的に最強のキーバインドはVisual Studio。ctrl+kの組み合わせのおかげでショートカットキーを豊富に使える。
vimのカーソル移動は最高なんだけど、他のエディタとctrl+f競合がつらい。
emacsはカーソル移動が残念。ctrl+fで右移動、ctrl+vでPageDownとか許せない。
vscodeはvsと似てて無難。当然だが。
IntellijはF5とかF6とかのリファクタリングが生理的嫌悪感。
Ctrl+KやCtrl+Eがコミットに取られているし、使わない機能も多い。

というわけで

@ogaty
ogaty / composer.md
Last active July 19, 2023 07:26
php composer
curl -sS https://getcomposer.org/installer | php

↑これはv1ね

メモリ不足

COMPOSER_MEMORY_LIMIT=-1 composer install
@ogaty
ogaty / sd.md
Last active July 19, 2023 04:31
一括置換

これはたしかにsedより楽だ
ripgrepとの組み合わせいいね

rg "fortune2018" -l | xargs sd "ogatism.jp/fortune2018/" "ogatism.jp/post/fortune2018/"
@ogaty
ogaty / laravel-validation.md
Last active July 19, 2023 04:31
laravel validation

バリデーション

Requestクラスでやる

php artisan make:request で authorizeをtrueにするのを忘れずに

    public function rules()
    {
        return [
@ogaty
ogaty / url.md
Last active July 19, 2023 04:29
javascript urlクラス
var x = new URL(location.href);

//path 置換
x.pathname = '/aaa';

// hash置換
x.hash = 'user';

// query置換
@ogaty
ogaty / luxon.md
Last active July 19, 2023 04:29
javascript datetime luxon

moment.jsよりも分かりやすい

https://moment.github.io/luxon/#/install

<script src="https://cdn.jsdelivr.net/npm/luxon@3.0.4/build/global/luxon.min.js"></script>

初期登録

var DateTime = luxon.DateTime;
@ogaty
ogaty / for.md
Last active July 19, 2023 04:28
色んな言語のfor foreach

JavaScript

// indexのみ
for (index in a) {
  console.log(a[index]);
}

// 中身のみ
for (i of a) {
 console.log(i);
@ogaty
ogaty / route.csv
Last active July 19, 2023 03:59
make url check test for laravel
admin method url controller name title
admin get /admin/news NewsController admin.news.index admin news
front get /news NewsController admin.news.index front news
@ogaty
ogaty / svg.php
Last active May 24, 2023 01:30
svg
<html>
<head>
</head>
<body>
<form method="POST" enctype="multipart/form-data">
<input type="file" name="svg" id="svg">
<input type="submit">