Skip to content

Instantly share code, notes, and snippets.

View tosik's full-sized avatar
🏠
Working from home

Toshiyuki Hirooka tosik

🏠
Working from home
  • Tokyo, Japan
View GitHub Profile
@tosik
tosik / build.sh
Last active September 20, 2018 13:01
gettext windows compilation error
curl -O http://public.p-knowledge.co.jp/gnu/gettext/gettext-0.19.8.1.tar.gz
tar -zxvf gettext-0.19.8.1.tar.gz
(cd gettext-0.19.8.1 && ./configure && make && make install)
wget http://download.savannah.gnu.org/releases/freetype/freetype-2.9.tar.gz
wget http://libsdl.org/release/SDL2-2.0.8.tar.gz
wget https://www.libsdl.org/projects/SDL_image/release/SDL2_image-2.0.3.tar.gz
wget https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-2.0.14.tar.gz
wget https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.2.tar.gz
wget http://public.p-knowledge.co.jp/gnu/gettext/gettext-latest.tar.gz
git clone https://github.com/libSDL2pp/libSDL2pp.git
tar -xvf freetype-2.9.tar.gz
tar -xvf SDL2-2.0.8.tar.gz
@tosik
tosik / Makefile
Last active August 22, 2018 01:39
ヘッダの依存関係も解決してくれる Makefile
CXX = clang++
TARGET = bin/main
DEBUG = -g -O0
#RELEASE = -O3
SRCDIRS := $(shell find src -type d)
SRCS = $(foreach dir, $(SRCDIRS), $(wildcard $(dir)/*.cpp))
OBJS = $(subst src/,obj/,$(SRCS:.cpp=.o))
DEPS = $(subst src/,obj/,$(SRCS:.cpp=.dep))
INCLUDES = -I./src
CXXFLAGS = $(DEBUG) $(RELEASE) -Wall -std=c++11 $(INCLUDES)
@tosik
tosik / generate-random-rle.rb
Last active April 8, 2019 15:04
generate all golly non-totalistic rules
random = `ruby non-totalistic-rules-random-picker.rb`
puts <<EOS
#CXRLE Pos=0,0
x = 328, y = 264, rule = #{random}
b4ob2ob2obo3bobobob5obobobo3bo2b3o2bo2bo3b2obo2b4ob2o4bob2ob4ob3o4b3o
2b3o6bo3b2o2bo3b2o3bo6b2obob3o2bo2bobobo7bob4o3bo7b2o5bob4o2bob2o3bob
2o4b2o2b2o3bobo4b2o3bobo3bob4o2bobobob4ob6ob2o2b3obo8bo4b2o2bob5ob3o3b
o3b2o2b3o3b2obo3bo3bo4b4ob2o2bo$2o3bobo2b5obob2obobobo2b2o2b2o3bo4b2o
2bo2bob2o4b2ob3o2b3o3b2o3b4ob4o3bob2ob3obob4o2bo3b2obobo2b2ob3obob2obo
@tosik
tosik / non-totalistic-rules.rb
Created August 14, 2018 14:01
generate all golly non-totalistic rules
table = {
"1" => "ce",
"2" => "cekain",
"3" => "cekainyqjr",
"4" => "cekainyqjrtwz",
"5" => "cekainyqjr",
"6" => "cekain",
"7" => "ce"
}
- install dropbox and start sync
- install iterm and run
- install homebrew
- run zsh
- add github ssh key
- git clone dotfiles
- brew install tmux
- install vim dein
- run vim and call dein#install()
デジコミ
ムービー
ミニアプリ
ダンジョン
タワー
ゴチャキャラ
トラップ
フィールド移動
マップ作成
@tosik
tosik / print-colourxxx.sh
Created July 11, 2018 01:06
Print color by colourXXX
for i in {0..255}; do
printf "\x1b[38;5;${i}mcolour${i}\x1b[0m\n"
done
g++ -std=c++11 foo.cpp
foo.cpp:11:63: error: cannot increment value of type 'const std::__1::__wrap_iter<const T *>'
for (const auto & it = foo.begin() ; it != foo.end() ; it ++);
~~ ^
1 error generated.
make: *** [all] Error 1
@tosik
tosik / log.sh
Created June 6, 2018 11:34
Boost.Test 実験
$ cat main.cpp
#define BOOST_TEST_MAIN
#include <boost/test/included/unit_test.hpp>
BOOST_AUTO_TEST_CASE(test_foo_1)
{
BOOST_CHECK(true);
}
$ g++ main.cpp