Skip to content

Instantly share code, notes, and snippets.

1) モデルだけのリポジトリ symlink
2) アプリ、モデルを分ける
3) APIで通信する(ActiveResourceで
4) サブアプリとして切り出す
5) Engine で切り出して、モデルは親のを使う
6) Microservices 化(API)
@inohiro
inohiro / pip_install_pygraphviz.log
Created August 19, 2013 06:07
"pip install pygraphviz" will be syntax error
$ pip install pygraphviz
Downloading/unpacking pygraphviz
Downloading pygraphviz-1.2.zip (103kB): 103kB downloaded
Running setup.py egg_info for package pygraphviz
Traceback (most recent call last):
File "<string>", line 16, in <module>
File "/private/var/folders/77/9rgd6n7d0tv4s9ng4dq9jydr0000gn/T/pip-build-inohiro/pygraphviz/setup.py", line 23
print "To install, run 'python setup.py install'"
^
SyntaxError: invalid syntax
@inohiro
inohiro / detect_fbx_format.rb
Created August 15, 2013 15:32
Detect fbx format (Binary one or ASCII one) with ruby
FILE_PATH = File.expand_path './file.fbx'
CORRECT = %w"K a y d a r a \ F B X \ B i n a r y \ \ "
def binary_fbx? file_path
File.open( file_path, 'rb' ) do |file|
CORRECT.each do |char|
num = file.read( 1 )
false if num != char
end
@inohiro
inohiro / acquaintanceship.md
Last active December 20, 2015 08:48
acquaintanceship for graduate school test-takers (graduate school of University of Tsukuba)
  • The exam will be enforced in Aug. 23th. (You should the check which the office will send)

  • We can find the information of rooms for written and oral exam at the near 3A building from 10:00 a.m. of previous day of the exam to the day of the exam.

  • You have to bring your admission ticket with you during exam.

  • You have to seat your appointed place by 10 min. before the start of exam.

  • You have to cancel the alarm of your cell phone, and also turn off it.

  • There is no clock at the room, you need to bring your watch.

@inohiro
inohiro / page_footer.txt
Last active December 15, 2015 17:09
Hatena Diary Design
@inohiro
inohiro / integer_separator.rb
Created July 26, 2012 10:02
separate integer value for dimension table
def main( i )
i = i.to_s
a = []
i.size.times do |j|
str = i[j]
( i.size - j - 1 ).times do
str << '0'
end
a << str.to_i
end
@inohiro
inohiro / rspec_executer.rb
Created June 14, 2012 18:16
rspec_executer.rb
BASE = "/home/inohiro/Projects/rails_2_3_14/src/admin_rails306/spec/lib/"
Dir.glob( BASE + '*.rb' ) do |f|
puts f
system( 'rspec ' + f ).to_s
end
@inohiro
inohiro / utf8_sign_inserter.rb
Created June 14, 2012 18:15
utf8_sign_inserter.rb
Dir.glob( "/home/inohiro/tmp/utf8_inserter/*.rb" ).each do |f|
File.open( f, "r+" ) do |file|
lines = file.readlines
lines.unshift "# -*- encoding: UTF-8 -*-\n"
file.rewind
lines.each do |line|
file.puts line
end
end
end
@inohiro
inohiro / ruby193p194_segv_2012_06_15.txt
Created June 14, 2012 16:22
ruby1.9.3-p194 SEGV on Mac OS X 10.5.8(i386)
inohiro@kde-no-mac-pro [Movie] $ ruby ./vertical.rb
file:/Users/inohiro/Data/Movie/linkedmdb-latest-dump.nt
./vertical.rb:59: [BUG] Segmentation fault
ruby 1.9.3p194 (2012-04-20 revision 35410) [i386-darwin9.8.0]
-- Control frame information -----------------------------------------------
c:0028 p:0157 s:0112 b:0107 l:0016c0 d:000106 BLOCK ./vertical.rb:59
c:0027 p:---- s:0102 b:0102 l:000101 d:000101 FINISH
c:0026 p:---- s:0100 b:0100 l:000099 d:000099 CFUNC :call
c:0025 p:0018 s:0096 b:0096 l:000088 d:000095 BLOCK /Users/inohiro/.rvm/gems/ruby-1.9.3-p194/gems/rdf-0.3.5.2/lib/rdf/reader.rb:297
@inohiro
inohiro / configure_result
Created June 13, 2012 06:09
Emacs 24.1 make failed on CnetOS 5.8 (i386)
localhost# ./configure --without-x
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes