Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryuhei Kobayashi yashihei

View GitHub Profile
@yashihei
yashihei / memo.md
Last active June 15, 2020 19:54
Spotifyのキャッシュを1GBに制限する(Windows)
View memo.md

AppDataが膨れ上がってるなと思ったらSpotifyお前だったのか (キャッシュが10GBぐらいあった…)

  1. Spotifyを閉じる
  2. C:\Users\{username}\AppData\Local\Spotify\Data のキャッシュを全部消す
  3. C:\Users\{username}\AppData\Roaming\Spotify\prefs に以下の設定を記述する
storage.size=1024
@yashihei
yashihei / memo.md
Created February 28, 2020 18:22
HHKB(US配列) + Windows + Google IME使ってるときの個人的セットアップ
View memo.md
  1. 背面スイッチは1, 3, 5をONに
    • Lite拡張モード(PC)
    • DeleteキーをBSに置き換える
    • ◇キーをAltに置き換える
  2. Google IMEの「プロパティ」「キー設定の選択」の編集を開く
  3. コマンド「IMEを有効化」「IMEを無効化」に「Ctrl Space」を割り当てる
@yashihei
yashihei / gist:d4bcbf02b2f55e048fbfd5a93f81e225
Last active April 20, 2019 16:31
bashで、スラッシュ -> バックスラッシュに置換したい時
View gist:d4bcbf02b2f55e048fbfd5a93f81e225

sedコマンドを使います。

sed [OPTION]... {script-only-if-no-other-script} [input-file]...

sedコマンドを使った置換の例。(abc -> ABC)

$ sed -e 's/abc/ABC/g'
@yashihei
yashihei / gist:45e57ccda275d94d361e3caebd680adc
Created April 19, 2019 13:32
bundle install時、ovirt-engine-sdkでコケる
View gist:45e57ccda275d94d361e3caebd680adc

(´・ω・`)

Fetching ovirt-engine-sdk 4.3.0
Installing ovirt-engine-sdk 4.3.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /home/hakase/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/ovirt-engine-sdk-4.3.0/ext/ovirtsdk4c
/home/hakase/.rbenv/versions/2.6.2/bin/ruby -I /home/hakase/.rbenv/versions/2.6.2/lib/ruby/2.6.0 -r ./siteconf20190419-51352-10rnc6r.rb extconf.rb
checking for xml2-config... yes
checking for curl-config... no
View gist:bc40d519d5b33bed3c60ce383d928c56

erbもっと楽に書きたい!

Gemfile以下を記載。

gem "haml-rails", "~> 2.0"

以下のコマンドでerb->hamlに変換。Rails5以降、rakeコマンドをrailsコマンドで叩けるようになった。

$ rails haml:erb2haml
@yashihei
yashihei / gist:0fed2089e35bb7bddc32d720d08da27a
Last active April 15, 2019 16:24
自宅のXubuntuをセットアップしていく
View gist:0fed2089e35bb7bddc32d720d08da27a

社のMacだけじゃなくて、自宅でもRailsとか触っていきたいので。かなり自分向けのメモ。
随時更新予定。

環境: Win10 + VMWare 14 + Xubuntu(LTS18.04)

VMwareのセットアップ

よしなに。

最初にやること

ホームディレクトリの日本語化。

@yashihei
yashihei / gist:4223b66af2ee09bf76b99e1ddfb2f86e
Last active October 31, 2022 10:53
Rider入れてからやったこと
View gist:4223b66af2ee09bf76b99e1ddfb2f86e

.gitignore

Unityの場合、以下の設定を.gitignoreに追加。

/.idea/

ideavim

Settings内の「Vim Emulation」でキー入力をVimで取るか、IDEで取るか選択出来る。

@yashihei
yashihei / tips.md
Last active June 21, 2020 04:03
BoxCast使うときのTips
View tips.md

RaycastやLinecastを使って、接地判定やショットの当たり判定を取ってたけど、やっぱり太さが欲しいのでBoxCastを使った。

BoxCastの死角

詳しくはテラシュールさんのブログ(http://tsubakit1.hateblo.jp/entry/2016/02/25/025922#BoxCast%E3%81%A8SphereCast%E3%81%AE%E6%AD%BB%E8%A7%92) にて書かれてる。BoxCastの仕様上、開始地点を判定しないのでその部分の判定をOverlapBoxなどで補う必要がある。

NonAlloc版のOverlapBoxについて

private Collider[] _buffer = new Collider[4];
@yashihei
yashihei / gist:de08869146f86834f37312f556f75eec
Last active May 10, 2019 10:30
masterでcommitしてしまった…って時
View gist:de08869146f86834f37312f556f75eec

まずは深呼吸。

git branch new_branch [ブランチを分けたいコミット]
git co new_branch
git graph master -n 10 | cat #とかでcherry-pickするコミット番号確認
git cherry-pick [cherry-pick の始点となるコミット]..[cherry-pick の終点となるコミット]
@yashihei
yashihei / memo.md
Last active October 30, 2019 12:38
uGUIのButtonでキー操作(パッド操作)オンリーのUI構築メモ
View memo.md

ButtonをLayoutGroupでいい感じに配置して終わりではって感じなんだけど、面倒なところが少しあったのでメモ

マウス入力問題

今回作っているゲームでは、基本的にマウスでUIは操作しないため、マウスの入力は無視したい。
マウス入力を無視するには、上に透明なレイヤをおいてそこでクリックを吸収する、とか他にも方法があるみたいだけど、今回はStandaloneInputModuleのマウス入力を無効化した。

using UnityEngine;
using UnityEngine.EventSystems;