Skip to content

Instantly share code, notes, and snippets.

@daenomo
daenomo / gist:5526806
Created May 6, 2013 17:55
emacsに追加したパッケージをとりあえずメモ。
ac-helm
ac-ja
ac-js2
all
all-ext
auto-async-byte-compile
auto-complete
auto-indent-mode
cl-lib
cygwin-mount

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップで git-flow についてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。

{- http://projecteuler.net/problem=2
Even Fibonacci numbers (偶数のフィボナッチ数) -}
-- フィボナッチ数列(1,2,3,5,8,13,21..)
let fibonacci = fib 1 2 where fib a b = a : fib b (a + b)
-- 400万以内で偶数のフィボナッチ数合計値
sum [x | x <- takeWhile (<= 4000000) fibonacci, even x]
@daenomo
daenomo / toshibaTokkyo.hs
Created January 5, 2013 15:17
最近見たニュースにちなんでhaskellのclassの使い方を練習してみた。まだよくわからん。
data System = System deriving (Show)
class SIer a where
makeTokkyoSystem :: a -> Maybe System
makeTokkyoSystem a = Just System
data Toshiba = Toshiba Int
instance SIer Toshiba where
makeTokkyoSystem a = Nothing
# yesod をとりあえず動かして見たメモ
wget http://lambda.haskell.org/platform/download/2012.2.0.0/haskell-platform-2012.2.0.0.tar.gz
wget http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-src.tar.bz2
tar xjf ghc-7.4.1-src.tar.bz2
cd ghc-7.4.1
yum install -y glibc-devel ncurses-devel gmp-devel autoconf automake libtool gcc make perl python ghc happy alex git
yum install -y docbook-utils docbook-utils-pdf docbook-style-xsl strace patch
perl boot
./configure
@daenomo
daenomo / sakata.hs
Created July 7, 2012 13:53
3 で割りきれるか 3を含む場合Ahoと表示。それ以外はそのまま。
aho x
| elem '3' (show x) == True = "Aho"
| x `mod` 3 == 0 = "Aho"
| otherwise = show x
sakata :: (Integral a, Show a) => [a] -> String
sakata x = unwords $ map aho x
main = do
putStrLn $ sakata [1..40]
@daenomo
daenomo / gist:3048519
Created July 4, 2012 17:35
map と 関数合成 と 優先度の低い関数適用 と リスト内包表記 を 意味もなく適当に書いた
map ((43+) . (+3)) $ take 5 [ x * 5 | x <- [1..], even x ]
@daenomo
daenomo / yajirushi.hs
Created June 26, 2012 18:06
-> が関数だったとは。
-- -> が関数だったとは。
-- Prelude> :i (->)
-- data (->) a b -- Defined in `GHC.Prim'
hoge :: (Num a) => a -> a
hoge a = a
hogehoge :: (Num a) => (->) a a
hogehoge a = a
@daenomo
daenomo / reverse.erl
Created June 22, 2012 17:25
erlang で reverse
-module(reverse).
-export([reverse/1]).
reverse(List) ->
case List of
[] -> [];
[Head|Tail] -> reverse(Tail) ++ [Head]
end.
@daenomo
daenomo / reverse.scala
Created June 22, 2012 17:04
Scala で reverse
def reverse[T](xs:List[T]):List[T] = xs match {
case Nil => xs
case head :: tail => reverse(tail) ::: List(head)
}
println(reverse(List(1,2,3,4,5)))