Skip to content

Instantly share code, notes, and snippets.

View usagi's full-sized avatar
🍣
Sushi

Usagi Ito usagi

🍣
Sushi
View GitHub Profile
@usagi
usagi / file0.cpp
Last active January 2, 2017 19:53
boost::shared_ptr から std::shared_ptr へ変換する簡単な方法 ref: http://qiita.com/usagi/items/3563ddb01e4eb342485e
// std::shared_ptr
#include <memory>
// boost::shared_ptr
#include <boost/shared_ptr.hpp>
auto main() -> int
{
boost::shared_ptr< int > b = boost::shared_ptr<int>( new int( 123 ) );
std::shared_ptr< int > s = std::shared_ptr<int>( x.get(), [x] ( ... ) mutable { } );
}

1. 1月10日の札幌に必要な装備

1.1. 靴

1.1.1. 要求される要素

  • 「0℃以下の圧雪凍結路」への「耐滑性」
    • 主に交差点または車道を歩行する際に必要となる性能です。
    • 札幌の歩行者の冬季の転倒事故や関連した交通事故で重篤な被害は主にここで発生します。歩行工程全体からすれば一般には高々、交差点、横断歩道を渡る時のみに必要となる圧雪凍結路への耐滑性ですが、死を招く重篤な転倒事故、関連した自動車との事故はこれを防ぐ事でほぼ回避できます。
  • 「2℃前後の舗装路の未除雪の深雪路」への「耐滑性」と「耐水性」
@usagi
usagi / file0.txt
Created September 26, 2016 08:52
ImGui でタグクラウド風のボタンクラウドを実装する例 ref: http://qiita.com/usagi/items/f26be05cce73e4798d56
namespace usagi
{
namespace imgui
{
class small_button_cloud
: public std::multimap
< std::string
, std::function< auto () -> void >
>
{
@usagi
usagi / file0.txt
Last active September 23, 2016 22:57
ImGui を使い"コンテキストメニュー"をもう少し"高度"にステートフルなオールインワン実装する例を紹介したい ref: http://qiita.com/usagi/items/671bc7c573a600819ac3
std::string label = "hoge";
std::string id = "xyz";
ImVec2 size;
auto clicked =
ImGui::Button
( ( id.empty() ? label : label + "###" + id ).c_str() // param-1 label & id
, size
);
@usagi
usagi / file0.txt
Last active September 23, 2016 05:51
Windows で作業中に"考え事をする為"に"ディスプレイを一瞬で真っ黒にする"方法 ref: http://qiita.com/usagi/items/fb7f15ef48a28768cacc
scrnsave.scr /s
@usagi
usagi / file0.txt
Created September 13, 2016 02:07
ninja コマンドなどのビルド完了時に"ベル"を鳴らすなど任意の通知を受けとるらいふはっく ref: http://qiita.com/usagi/items/682cba4951878967bb9c
function ninja()
{
env ninja $@
R=$?
echo -e '\a'
return R
}
@usagi
usagi / file0.conf
Last active December 3, 2018 04:46
nginx `location ~` 正規表現でマッチした部分文字列を回収して使う方法 ref: https://qiita.com/usagi/items/b90b7fb3e9aa5f528ffc
location ~ ^/packages/(?<author>[a-z]+)/(?<name>[a-z]+)/?$
{
proxy_pass http://127.0.0.1:5984/packages/_design/main/_view/main?key="$author/$name";
}
@usagi
usagi / file0.txt
Last active August 30, 2016 20:27
CouchDB のきほんチートシート curl 編 ref: http://qiita.com/usagi/items/ffe7b2cde9f2f8b1b7f4
HTTP/1.1 200 OK
Server: CouchDB/1.6.1 (Erlang OTP/18)
ETag: "8-0517d1736e63d34d91db334b97a2a94b"
Date: Tue, 30 Aug 2016 20:21:39 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 58
Cache-Control: must-revalidate
@usagi
usagi / file0.txt
Last active August 28, 2016 02:46
nginx で C++14 の FCGI を動作させる簡単な方法の紹介 ref: http://qiita.com/usagi/items/d322a7f27806a8648f0c
sudo apt install nginx clang-3.8 libfcgi-dev spawn-fcgi
@usagi
usagi / file0.txt
Created August 13, 2016 14:35
Postfix の luser_relay に複数のドメインを設定する方法 ref: http://qiita.com/usagi/items/d401a9cc5c1dff97cd74
luser_relay = target
local_recipient_maps =