This file contains 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
import Test.HUnit | |
-- Target Function for Test | |
leap :: Integral a => a -> Bool | |
leap year = if d 100 then d 400 | |
else d 4 | |
where divisible = (== 0) . (mod year) | |
d = divisible | |
-- Test Method |
This file contains 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
ghc-pkg list | sed 's/,/, /g' | tr ',' '\n' | grep '(' |
This file contains 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
// -*- mode:c; coding:utf-8; -*- | |
// INSERTION SORT PROGRAM | |
// | |
// <ORDER> | |
// BEST: O(n) | |
// AVERAGE: O(n^2) | |
// WORST: O(n^2) | |
#include <stdio.h> | |
#include <stdlib.h> |
This file contains 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
#!usr/bin/sh | |
if [ $# -lt 2 ]; then | |
echo $0 Failed : Please give 2 arguments \”NAME\(string\) AGE\(natural number\)\" | |
exit | |
fi | |
name=$1 | |
age=$2 | |
yes "happy birthday $name" | head -n $age | say -v Good |
This file contains 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
class Integer #Override | |
def prime? #boolean: itself is prime or not. | |
return true if self == 2 | |
return false if self < 2 || self % 2 == 0 | |
limit = Math::sqrt(self).ceil | |
(3..limit).step(2) { |i| | |
return false if self % i == 0 | |
} | |
return true | |
end #prime? |
This file contains 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
require 'formula' | |
class Gauche < Formula | |
url 'http://jaist.dl.sourceforge.net/gauche/Gauche/Gauche-0.9.1.tgz' | |
homepage 'http://practical-scheme.net/gauche/' | |
md5 '' | |
def install | |
system "./configure", "--enable-multibyte=utf-8", "--prefix=#{prefix}" |
This file contains 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
" vimrc | |
" Window | |
set laststatus=2 | |
" Buffer | |
set number | |
syntax enable | |
set expandtab | |
set tabstop=4 |
This file contains 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
# Install Common Vim environment | |
ln -fs $PWD/vim/vimrc.vim $HOME/.vimrc | |
ln -fs $PWD/vim/gvimrc.vim $HOME/.gvimrc | |
# Create Vimfiles Directory | |
mkdir $HOME/.vim | |
# Added Local Environment vimfiles Setting | |
mkdir $HOME/.vim/runtime | |
touch $HOME/.vim/runtime/vimrc.vim |
This file contains 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
animateCSS = (css, duration = '1s', timing_function = 'linear', delay = 0) -> | |
obj = {} | |
if css? | |
animate = '' | |
for property, value of css | |
obj[property] = value | |
animate += ', ' unless animate is '' | |
animate += "#{property} #{duration} #{timing_function} #{delay}" | |
if animate isnt '' | |
for browser in ['', '-o-', '-moz-', '-webkit-'] |
This file contains 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
(function() { | |
var animateCSS; | |
animateCSS = function(css, duration, timing_function, delay) { | |
var animate, browser, obj, property, value, _i, _len, _ref; | |
if (duration == null) { | |
duration = '1s'; | |
} | |
if (timing_function == null) { | |
timing_function = 'linear'; | |
} |