Skip to content

Instantly share code, notes, and snippets.

View myokoym's full-sized avatar
💭
hi

Masafumi Yokoyama myokoym

💭
hi
View GitHub Profile
@myokoym
myokoym / space_invaders.rb
Last active April 6, 2017 23:45
A game as Space Invaders using Gosu and Ruby. (under construction...)
#
# space_invaders.rb:
# A game as Space Invaders using Gosu and Ruby.
#
# Authors:
# (c) 2014 Masafumi Yokoyama
#
# License:
# This program is licensed under the MIT License.
#
@myokoym
myokoym / toaru_text_image_generator.rb
Last active December 18, 2016 14:06
とある文字列の画像を生成するRubyスクリプト - Powered by rcairo
require 'cairo'
format = Cairo::FORMAT_ARGB32
width = 380
height = 205
@surface = Cairo::ImageSurface.new(format, width, height)
@context = Cairo::Context.new(@surface)
# 背景
まとめ > [1] この機能は Firefox 47 から使用できますが設定項目 dom.details_element.enabled で制御しており、Nightly および Aurora バージョンを除き既定値は false です。 (バグ 1241750)。Firefox 49.0 より、この機能がデフォルトで有効になります。すなわち、設定項目の既定値が true になります (バグ 1226455)。
Click Here!

[詳細はWebで!](https://developer.mozilla.org/ja/docs/Web/HTML/Element/details#Browser_compatibility)

class Board
def initialize
@board = [
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x22, 0x23, 0x24, 0x25, 0x28, 0x25, 0x24, 0x23, 0x22, 0x40,
0x40, 0x00, 0x27, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x00, 0x40,
0x40, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x40,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
@myokoym
myokoym / repos
Last active January 15, 2016 07:59
ab-default-search
achook
alertinvalidaddresses
always-default-client
alwayssendlater
attachment-encoding-localized-autodetect
auto-password-registerer
auto-search-folder
autodecodeuri
autopermission
@myokoym
myokoym / ruby-pango-dependencies.dwp
Created December 4, 2013 16:32
For "Dependency Walker".
SxS
KnownDLLs
AppDir
32BitSysDir
16BitSysDir
OSDir
AppPath
SysPath
UserDir C:\Ruby200\lib\ruby\gems\2.0.0\gems\cairo-1.12.6-x86-mingw32\vendor\local\bin\
UserDir C:\Ruby200\lib\ruby\gems\2.0.0\gems\cairo-1.12.6-x86-mingw32\vendor\local\lib\
@myokoym
myokoym / rcairo-rake-invalid-byte-sequence.log
Last active December 29, 2015 19:39
ja_JP.UTF-8でない環境でrcairoのrakeが動かない
% git clone https://github.com/rcairo/rcairo
% cd rcairo
% LANG=C rake -T
rake aborted!
There was a ArgumentError while loading cairo.gemspec:
invalid byte sequence in US-ASCII from
/home/myokoym/work/ruby/rcairo.win32/cairo.gemspec:14:in `==='
/home/myokoym/work/ruby/rcairo.win32/Rakefile:23:in `new'
@myokoym
myokoym / rabbit-recipes.rd
Last active December 29, 2015 17:49
Rabbitのレシピ集。追加要望受付中。公式はこちら http://rabbit-shocker.org/ja/sample/
= Rabbitレシピ
:theme
groonga
= 図と箇条書きの文を\n水平に並べる
# image
# src = http://myokoym.net/public/chuork01-icon1.png
# relative_width = 40
@myokoym
myokoym / pango-win32-build.log
Created November 18, 2013 18:18
pangoのgem:win32:buildで/usr/bin/i686-w64-mingw32-ld: cannot find -lruby-cairo
% RUBYLIB="$HOME/work/ruby/pkg-config/lib" MAKE_N_JOBS=4 rake gem:win32:build
/home/myokoym/.rubies/ruby-2.0.0-p247/bin/ruby -S rake native:build win32:build
rm -rf /home/myokoym/work/ruby/ruby-gnome2.win32/pango/tmp/harfbuzz
mkdir -p /home/myokoym/work/ruby/ruby-gnome2.win32/pango/tmp/harfbuzz
tar xf /home/myokoym/work/ruby/ruby-gnome2.win32/pango/tmp/download/harfbuzz-0.9.17.tar.bz2
patch -p1 < /home/myokoym/work/ruby/ruby-gnome2.win32/pango/patches/harfbuzz-0.9.17-disable-uniscribe.diff
patching file configure.ac
autoreconf --install
src/Makefile.am:276: warning: '%'-style pattern rules are a GNU make extension
parallel-tests: installing './test-driver'
@myokoym
myokoym / rake-compiler-config.yml
Last active December 27, 2015 09:19
`require': cannot load such file -- pkg-config (LoadError) in gem:win32:build:ext
---
rbconfig-i386-mingw32-2.0.0: /home/myokoym/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p247/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
rbconfig-x86-mingw32-2.0.0: /home/myokoym/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p247/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
rbconfig-i386-mswin32-60-2.0.0: /home/myokoym/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p247/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
rbconfig-x86-mswin32-60-2.0.0: /home/myokoym/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p247/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
rbconfig-2.0.0: /home/myokoym/.rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p247/lib/ruby/2.0.0/i386-mingw32/rbconfig.rb
rbconfig-1.9.3: /home/myokoym/.rake-compiler/ruby/ruby-1.9.3-p448/lib/ruby/1.9.1/i386-mingw32/rbconfig.rb