Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Kazuhiro Homma kazuph

🏠
Working from home
View GitHub Profile
View gist:2498001
# install perlbrew and install perl-5.12.4 on Mac OS X Lion
$ curl -LO http://xrl.us/perlbrew
$ perl perlbrew install
$ rm perlbrew
$ ~/perl5/perlbrew/bin/perlbrew init
$ echo 'source ~/perl5/perlbrew/etc/bashrc' >> ~/.bashrc
$ source ~/.bashrc
(if you use ZSH?, then replace ".bashrc" -> ".zshrc".)
$ export PERLBREW_ROOT=${HOME}/perl5/perlbrew
$ curl -k -L https://raw.github.com/gist/962406/93cd90f5e6c6a86073afb3815f0ea06c3c9e99ed/patchperl -o $PERLBREW_ROOT/bin/patchperl
View gist:2501207
<!-- Start jQuery Mobile -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
<!-- End jQuery Mobile -->
View gist:2501353
<!-- jQuery Mobile by Zencoding -->
html:5>div[data-role=page]>(div[data-role=header][data-position=fixed]>h1{jQueryMobile}))+(ul[data-role=listview]>li[data-role=list-divider]{HOGE}+li*30>legend+a{(」・ω・)」うー!(/・ω・)/にゃー!}>img[src=praykazu.png][width=100px])+(div[data-role=footer][data-position=fixed]>h1{I am Footer})
<!-- End -->
View gist:2504014
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.css" />
<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.1.0/jquery.mobile-1.1.0.min.js"></script>
</head>
<body>
View gist:2504175
<!-- jQuery Mobile の初期設定, headではjQueryとjQuery Mobileの定義の間に書く -->
<script type="text/javascript">
$(document).bind("mobileinit",
function(){
//$.mobile.ajaxEnabled = false; //Ajaxの仕様を無効にする
$.mobile.defaultPageTransition = "none"; //画面遷移方法の選択
$.mobile.loadingMessage = "ページ読み込み中...";
$.mobile.pageLoadErrorMessage = "ページの読み込みに<br />失敗しました";
});
</script>
@kazuph
kazuph / install_neobundle.shell
Created May 20, 2012
NeoBundleのインストール方法
View install_neobundle.shell
$ mkdir -p ~/.vim/bundle
$ git clone https://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim
@kazuph
kazuph / problem036.rb
Created Aug 27, 2012
ProjectEuler Problem 36
View problem036.rb
#!/usr/bin/env ruby
p (1..999_999).select{|n| n.to_s == n.to_s.reverse and n.to_s(2) == n.to_s(2).reverse}.inject(:+) # => 872187
@kazuph
kazuph / problem037.rb
Created Aug 28, 2012
ProjectEuler Problem 37
View problem037.rb
#!/usr/bin/env ruby
# encoding : utf-8
require 'set'
t = Time.now
# 素数の判定
def prime?(num, ary)
ary.each do |n|
break if n * n > num
return false if num % n == 0
@kazuph
kazuph / project_euler_011.rb
Created Oct 19, 2012
ProjectEuler Problem 11
View project_euler_011.rb
data = [ [8,2,22,97,38,15,0,40,0,75,4,5,7,78,52,12,50,77,91,8],
[49,49,99,40,17,81,18,57,60,87,17,40,98,43,69,48,4,56,62,0],
[81,49,31,73,55,79,14,29,93,71,40,67,53,88,30,3,49,13,36,65],
[52,70,95,23,4,60,11,42,69,24,68,56,1,32,56,71,37,2,36,91],
[22,31,16,71,51,67,63,89,41,92,36,54,22,40,40,28,66,33,13,80],
[24,47,32,60,99,3,45,2,44,75,33,53,78,36,84,20,35,17,12,50],
[32,98,81,28,64,23,67,10,26,38,40,67,59,54,70,66,18,38,64,70],
[67,26,20,68,2,62,12,20,95,63,94,39,63,8,40,91,66,49,94,21],
[24,55,58,5,66,73,99,26,97,17,78,78,96,83,14,88,34,89,63,72],
[21,36,23,9,75,0,76,44,20,45,35,14,0,61,33,97,34,31,33,95],
You can’t perform that action at this time.