This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
hg clone http://vim.googlecode.com/hg vim | |
cd vim | |
./configure --enable-multibyte | |
make | |
make test | |
sudo make install | |
cd .. | |
rm -rf vim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# iedevのVim勉強会(http://atnd.org/events/30822)用のスクリプト。 | |
# vunldeとref.vimをインストール + webdict周りの設定をします。 | |
# git と w3m は用意しておいてください | |
# git のチェック | |
which git > /dev/null | |
if [ $? -ne 0 ]; then | |
echo git not found. please install git. | |
exit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
file = File.open("filename","r") | |
2.times { file.gets.chomp } | |
data = "" | |
while data = file.gets | |
puts data | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int test(void){ | |
int n = 2; | |
n = ++n; | |
printf("%d\n",n); // 3 | |
return 0; | |
} | |
int hoge(void){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = gets.chomp | |
config.consumer_secret = gets.chomp | |
config.oauth_token = gets.chomp | |
config.oauth_token_secret = gets.chomp | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (A x y) | |
(cond ((= y 0) 0) | |
((= x 0) (* 2 y)) | |
((= y 1) 2) | |
(else (A (- x 1) | |
(A x (- y 1)))))) | |
(A 1 10) | |
(A 2 4) | |
(A 3 3) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (hoge a b c) | |
(define (square x) (* x x)) | |
(define (minimum x y) (if (< x y) x y)) | |
(- | |
(+ (square a) (square b) (square c)) | |
(square (minimum a (minimum b c))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def prime? num | |
return 0 if num == 1 | |
(num-1).downto(2) do |n| | |
return 0 if num.modulo(n) == 0 | |
end | |
return 1 | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# shell script option test | |
a=0 | |
b=0 | |
while getopts ab opt | |
do | |
case ${opt} in | |
a) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# fooが頭に無いbarをファイルに出力する 2.2 | |
array = ["foo","bar","baz","hoge"] | |
file_name = "./hoge.txt" | |
f = File.open file_name,"a+" | |
array.each do |head| |