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
# - Description | |
# This program enables you to create a buck up with date in its name, | |
# which contains files symbolic links in copy source refers. | |
#-------------------- | |
# Usage | |
#-------------------- | |
# $ bak /path/to/source /path/to/dest | |
#!/bin/sh |
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
1 | 鈴木 達矢 | 19800324 | 1 | |
---|---|---|---|---|
3 | Matthew Day | 19850324 | 0 | |
5 | 人見 裕 | 19811103 | 3 | |
2 | Jerome Kumori | 19880505 | 1 | |
4 | Agata Znamienkiewicz | 19821213 | 0 |
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
# This is a code snippet for my exercise on Lambda and Proc. | |
# Let's say there is a supermarket which sells only three products bellow. | |
# Product Code | Name | Price | |
# FR1 | Fruit Tea | £3.11 | |
# SR1 | Strawberries| £5.00 | |
# CF1 | Coffee | £11.23 | |
# - It offers buy-one-get-one-free for fruit tea. | |
# - It offers strawberries to get a price discount for bulk purchases. If you buy 3 or more strawberries, the price should drop to £4.50. |
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
# Usage; | |
# htmls2hamls RAILS_ROOT/app/views/TARGETS | |
# Assume $1 is path to directory containing views in a rails project and $2 | |
: $1 | |
if test -d $1 | |
then echo 'processing..' | |
else echo Directory path must be specified for first argument; exit |
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
$ cat /home/suzukimilanpaak/.rvm/log/libiconv/autoreconf.log | |
[2011-11-26 16:52:46] autoreconf -is --force | |
configure.ac:134: warning: AC_LANG_CONFTEST: no AC_LANG_SOURCE call detected in body | |
../../lib/autoconf/lang.m4:194: AC_LANG_CONFTEST is expanded from... | |
../../lib/autoconf/general.m4:2591: _AC_COMPILE_IFELSE is expanded from... | |
../../lib/autoconf/general.m4:2607: AC_COMPILE_IFELSE is expanded from... | |
../../lib/m4sugar/m4sh.m4:606: AS_IF is expanded from... | |
../../lib/autoconf/general.m4:2032: AC_CACHE_VAL is expanded from... | |
../../lib/autoconf/general.m4:2053: AC_CACHE_CHECK is expanded from... | |
configure.ac:134: the top level |
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
# coding: utf-8 | |
require 'spec_helper' | |
describe Time do | |
TIMETABLE = [Time.local(2012, 10, 26, 21), Time.local(2012, 11, 2, 21)] | |
describe '#now' do | |
let!(:now) { | |
now = Time.now | |
puts "in let! #{now}" |
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 Human # => design | |
def say_hello(name) | |
'hello' + name | |
end | |
end | |
@human = Human.new # instance | |
@human.say_hello('David') | |
#=> 'hello David' |
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 Website < ActiveRecord::Base | |
has_and_belongs_to_many :categories, after_add: :increment_categories_counter_cache, after_remove: :decrement_categories_counter_cache | |
private | |
def increment_categories_counter_cache(category) | |
Category.increment_counter(:websites_count, category.id ) | |
end | |
def decrement_categories_counter_cache(category) |
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
// Size of display | |
int DISPLAY_WIDTH = 500; | |
int DISPLAY_HEIGHT = 500; | |
// Colours | |
int BLACK = 0; | |
int WHITE = 255; | |
int CENTER_X = 0; | |
int CENTER_Y = 0; | |
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 java.util.*; | |
Fibonacci fibonacci; | |
float unitAngle; | |
float unitFibonacciAngle; | |
int NUM_POINTS = 90; | |
float NUM_DISTANCE_FROM_APEX = 1; | |
class Fibonacci { |
OlderNewer