Skip to content

Instantly share code, notes, and snippets.

View yashihei's full-sized avatar

Ryuhei Kobayashi yashihei

View GitHub Profile

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をセットアップしていく

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

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

VMwareのセットアップ

よしなに。

最初にやること

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

@yashihei
yashihei / memo.md
Last active June 14, 2017 16:26
Windowsでターミナル環境なメモ
@yashihei
yashihei / memo.md
Last active June 14, 2017 16:25
DirectX初期化メモ

プロジェクトの設定

「VC++ Directories」→「Include Directories」
$(DXSDK_DIR)Include;$(IncludePath)

「VC++ Directories」→「Library Directories」
$(DXSDK_DIR)Lib\x86;$(LibraryPath)

「Linker」→「Input」

d3dx9d.lib;d3d9.lib;winmm.lib;dxguid.lib;dinput8.lib;xinput.lib (Debug)
d3dx9.lib;d3d9.lib;winmm.lib;dxguid.lib;dinput8.lib;xinput.lib (Relese)

#include <winbase.h>
#include <boost/format.hpp>
inline void Log(boost::format &bfmt) {
#if defined(_DEBUG)
OutputDebugString(bfmt.str().c_str());
#endif
}
template<class First, class... Rest>
@yashihei
yashihei / debug.cpp
Created February 15, 2016 21:34
何か数値をログに出したい時
template <typename Type> inline void OutputDebugValue(Type& value) {
OutputDebugString(std::to_string(value).c_str());
OutputDebugString("\n");
}
#include <Siv3D.hpp>
//色々だるいしシーケンスグローバル
enum class State {
TITLE,
IN_GAME,
GAMEOVER,
CLEAR,
};
@yashihei
yashihei / main.cpp
Last active January 2, 2016 05:49
オレオレ仕様Dxlibのmain.cpp
#include <Dxlib.h>
#pragma warning(disable:4996)
int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow ) {
//SetGraphMode();画面サイズ任意
if (MessageBox(NULL,"フルスクリーンで起動しますか?","起動オプション",MB_YESNO) == IDYES) {
ChangeWindowMode(FALSE);
} else {
ChangeWindowMode(TRUE);
}
@yashihei
yashihei / loli.bat
Last active December 31, 2015 08:29
a.exe < 2014-yo-t%1-in1.txt > 2014-yo-t%1-out1.txt
a.exe < 2014-yo-t%1-in2.txt > 2014-yo-t%1-out2.txt
a.exe < 2014-yo-t%1-in3.txt > 2014-yo-t%1-out3.txt
a.exe < 2014-yo-t%1-in4.txt > 2014-yo-t%1-out4.txt
a.exe < 2014-yo-t%1-in5.txt > 2014-yo-t%1-out5.txt
#include <iostream>
#include <chrono>
using namespace std;
int main()
{
auto begin = chrono::high_resolution_clock::now();
//計測したい処理