Skip to content

Instantly share code, notes, and snippets.

Avatar
👶
parenting

Shinichi Maeshima willnet

👶
parenting
View GitHub Profile
View rails_template_for_3.1.rb
# -*- coding: utf-8 -*-
#
# Usage
#
# rails new yourapp -m https://raw.github.com/gist/1178242/3c77cfffeb99f32d19333de986ff41283aa9eb26/rails_template_for_3.1.rb -T --skip-bundle
#
git :init
append_file '.gitignore', <<-END
@willnet
willnet / ext_array.rb
Created Sep 12, 2011
devquiz2011スライドパズル用コード
View ext_array.rb
# -*- coding: utf-8 -*-
class Array
def point(x, y)
self[y][x]
end
def set_point(x, y, char)
self[y][x] = char
self
@willnet
willnet / webgame.coffee
Created Sep 12, 2011
devquiz2011webgame用コード
View webgame.coffee
click = (id) ->
element = document.getElementById('card' + id)
myevent = document.createEvent('MouseEvents')
myevent.initEvent('click', false, true)
element.dispatchEvent(myevent)
element
size = $('.card').size() - 1
ary = new Array(size)
@willnet
willnet / hitorigame.rb
Created Sep 12, 2011
devquiz2011一人ゲーム用コード
View hitorigame.rb
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
input =<<EOS
100
2
10 11
3
0 9 9
4
@willnet
willnet / gist:1232034
Created Sep 21, 2011
qt install error log
View gist:1232034
==> Downloading http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4
File already downloaded and cached to /Users/maeshima/Library/Caches/Homebrew
==> ./configure -prefix /usr/local/Cellar/qt/4.7.3 -system-libpng -system-zlib -
==> make
cd src/tools/bootstrap/ && make -f Makefile
/usr/bin/c++ -c -O3 -w -pipe -fvisibility=hidden -I/usr/X11/include -Xarch_x86_64 -mmacosx-version-min=10.5 -O2 -fPIC -arch x86_64 -Xarch_x86_64 -mmacosx-version-min=10.5 -Wall -W -DQT_BOOTSTRAPPED -DQT_LITE_UNICODE -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_CODECS -DQT_NO_DATASTREAM -DQT_NO_GEOM_VARIANT -DQT_NO_LIBRARY -DQT_NO_QOBJECT -DQT_NO_STL -DQT_NO_SYSTEMLOCALE -DQT_NO_TEXTSTREAM -DQT_NO_THREAD -DQT_NO_UNICODETABLES -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I../../../mkspecs/macx-g++ -I. -I../../../include -I../../../include/QtCore -I../../../include/QtXml -o .obj/release-static/qisciicodec.o ../../corelib/codecs/qisciicodec.cpp
/usr/bin/c++ -c -O3 -w -pipe -fvisibility=hidden -
@willnet
willnet / setup_chef.sh
Created Jan 24, 2012
ec2 amazon instance に chef を導入するまでの手順
View setup_chef.sh
sudo yum install emacs git zsh gcc make readline readline-devel libyaml libyaml-devel zlib zlib-devel openssl openssl-devel
mkdir src
cd src
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
tar zxvf ruby-1.9.3-p0.tar.gz
cd ruby-1.9.3-p0
./configure
make
sudo make install
cd /home/ec2-user/src/ruby-1.9.3-p0/ext/openssl
@willnet
willnet / gist:1698698
Created Jan 29, 2012
install and setting manual for mysql on ec2-micro
View gist:1698698
sudo yum install mysql mysql-server mysql-devel
sudo cp /etc/my.cnf /etc/my.cnf.orig
wget https://raw.github.com/willnet/config/master/my.cnf.ec2-micro
sudo mv my.cnf.ec2-micro /etc/my.cnf
sudo mysql_install_db
sudo mysqld_safe --defaults-file=/etc/my.cnf --user=mysql &
mysql -u root
TRUNCATE TABLE mysql.user;
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'xxxxxxxx' WITH GRANT OPTION;
@willnet
willnet / gist:1699502
Created Jan 29, 2012
install node manual on ec2-micro
View gist:1699502
sudo yum install gcc-c++
wget http://nodejs.org/dist/v0.6.9/node-v0.6.9.tar.gz
tar zxvf node-v0.6.9.tar.gz
cd node-v0.6.9
./configure
make
sudo make install
@willnet
willnet / gist:1701448
Created Jan 29, 2012
install pssenger and nginx manual on ec2-micro
View gist:1701448
sudo yum install libcurl-devel
wget http://nginx.org/download/nginx-1.0.11.tar.gz
tar zxvf nginx-1.0.11.tar.gz
sudo /usr/local/bin/gem install passenger
cd /usr/local/lib/ruby/gems/1.9.1/gems/passenger-3.0.11/bin
sudo env PATH=/usr/local/bin:$PATH ./passenger-install-nginx-module
@willnet
willnet / gist:1703102
Created Jan 30, 2012
install manual of swfmill on mac
View gist:1703102
# http://download.savannah.gnu.org/releases/freetype/ から最新のfreetypeをダウンロード
tar zxvf freetype-x.x.x
cd freetype
./configure
make
sudo make install
curl -O http://www.swfmill.org/releases/swfmill-0.3.2.tar.gz
tar zxvf swfmill-0.3.2.tar.gz
cd swfmill-0.3.2