Skip to content

Instantly share code, notes, and snippets.

View hotwatermorning's full-sized avatar

hotwatermorning hotwatermorning

View GitHub Profile
[[起動時のダイアログ]]
*************************************************************************************
function vital#of の処理中にエラーが検出されました:
行 10:
E117: 未知の関数です: vital#_42446ba^M#new
E15: 無効な式です: vital#_{ver[0]}#new()
#include <iostream>
template<int N>
struct sum
{
enum { value = N + sum<N-1>::value };
};
template<>
@hotwatermorning
hotwatermorning / gist:5010090
Last active December 14, 2015 01:59
debugger visualizer for boost::string_ref.
;------------------------------------------------------------------------------
; boost::string_ref
;------------------------------------------------------------------------------
boost::basic_string_ref<char,*> {
children (
#(
#([raw] : [$c.ptr_,!]),
#array(expr : $c.ptr_[$i], size : $c.len_)
)
)
@hotwatermorning
hotwatermorning / DrawBitmap.cpp
Last active August 29, 2015 14:16
Draw bitmap image to memory
// DrawBitmap.cpp
// バイト列にビットマップデータを書き込んでウィンドウに表示。
#include <cassert>
#include <cstdint>
#include <algorithm>
#include <memory>
#define WIN32_LEAN_AND_MEAN // Windows ヘッダーから使用されていない部分を除外します。
// Windows ヘッダー ファイル:
@hotwatermorning
hotwatermorning / perlin_noise.cpp
Last active August 29, 2015 14:16
perlin_noise
// perlin_noise_cpp.cpp
// http://postd.cc/the-laws-of-shitty-dashboard-2/
#include <cassert>
#include <cstdint>
#include <algorithm>
#include <memory>
#define UNICODE
@hotwatermorning
hotwatermorning / input_filter.sh
Last active April 20, 2018 05:24
doxygenでコメントに改行を付加する
# doxygenはソース中の改行を空白一文字に変換してしまう。
# 日本語でドキュメントを書いている場合は
# これによって文章中に余計な空白が追加されることになって嬉しくない。
#
# このinput_filterは、
# //!という行形式のコメントが連続するドキュメントに対して、最後の行以外に<br>を付加する
# /*! */または/** */という複数行形式のドキュメント対して、
# (先頭行/最後の行/空白行)以外に<br>を付加する。
# また、先頭行が/*!あるいは/**だけではなくテキストが存在している場合は先頭行にも<br>を付加する
#
git config --global alias.log-graph "log --pretty=format:'%C(yellow)%h%Creset %C(cyan)%an%Creset %s
|______ %C(green)%ad%Creset %C(magenta)%d%Creset' --date=iso --graph"
@hotwatermorning
hotwatermorning / tab_win_name.sh
Last active October 21, 2015 01:07
Naming terminal tabs in osx lion
# http://thelucid.com/2012/01/04/naming-your-terminal-tabs-in-osx-lion/
function tabname {
printf "\e]1;$1\a"
}
function winname {
printf "\e]2;$1\a"
}
@hotwatermorning
hotwatermorning / gist:59ff039261216a55de21
Created November 5, 2015 05:08
[WebGL] shaderとprogramのエラーを得る方法
var canvas;
var gl;
var program;
function createGlContext()
{
canvas = document.getElementById("container");
gl = canvas.getContext("webgl");
}
@hotwatermorning
hotwatermorning / apply_function.cpp
Last active December 16, 2015 01:49
Apply function to variant variable using generic lambda.
template<class F, class Ret = void>
struct Apply : boost::static_visitor<Ret>
{
Apply(F f) : f_(std::move(f)) {}
template<class T>
Ret operator()(T &t) { return f_(t); }
template<class T>
Ret operator()(T &t) const { return f_(t); }