Skip to content

Instantly share code, notes, and snippets.

@yattom
yattom / price.js
Last active August 29, 2015 14:10
An node script to get prices from Amazon (Japan). I threw away in the middle when I realized that prices for Kindle books are not available with Product Advertising API.
// An ugly quick hack to get prices from Amazon
// Using node-apac https://github.com/dmcquay/node-apac/
// and almost same as the example in its README
var util = require('util'),
OperationHelper = require('apac').OperationHelper;
var opHelper = new OperationHelper({
awsId: process.env.AWS_ID,
awsSecret: process.env.AWS_SECRET,
assocId: process.env.ASSOCIATE_ID,
@yattom
yattom / right_triangle_of_natural_numbers.py
Created December 8, 2014 00:05
Search for right rectangles with edges of natural number length.
def right_triangle_of_natural_numbers(max_n):
'''
Return all right traiangles whose edges are natural number length.
Triangles of same ratio are discarded.
>>> right_triangle_of_natural_numbers(5)
[(5, 4, 3)]
>>> right_triangle_of_natural_numbers(20)
[(5, 4, 3), (13, 12, 5), (17, 15, 8)]
'''
@yattom
yattom / gist:25b5f225cc07ddaee582
Created March 26, 2015 04:25
Fearless Changeワークショップのやり方

kawagutiさんが公開してくれたFearless Changeのワークショップの簡単な内容です。

https://github.com/kawaguti/fearless-change-pub/tree/master/carddeck

  1. 人を集める。Fearless Changeやパターンを勉強するとは言わず、みんなの現状と課題を共有できるワークショップがあるからやってみようと声をかける。
  2. 資料を印刷する(5,6人なら1セット63枚。8人以上なら4~6人ずつに分け、グループごとにセット準備)。できればコピー用紙ではなく、B6か3x5のカードに印刷する。
  3. まず白紙のカードを配り、各自で現在感じている問題を書いてもらう。1枚1点で、何枚書いてもいい。(5分)
  4. 各自書いた中で一番重要と思う問題を1枚選び、全員で発表する。
  5. パターンのカードを机にばらまき、みんなで眺めながら、誰かの問題に使えるかも?と思うものを見つけて共有したり話し合ったりする。組み合わせや順序も考えてみる。 (5.は、誰かの問題1つだけに絞って全員で探しても良い)
An experimental tralnslation of http://alistair.cockburn.us/Heart+of+Agile+Fortune+Teller+in+English into Japanese.
COLLABORATE 協働
+1 : COLLABORATE 協働
+1 : How does it feel to take turns contributing ? お互いに助け合ったらどんな気分だろう?
+1 : TRUST 信頼

First you want some software. You know what you want, so it makes sense that it’s most convenient if the the software is built by yourself.

Unfortunately (or luckily) you’re too busy doing your own stuff to write a software. You call up someone and ask him to write the software for you. You save time and he got a job. Win-Win!

But wait. He needs to understand what you want. You need to tell the developer what you want. You need communication. One of the problems of communication is you cannot tell if you successfully communicated. You ask something. The only way to see if your request is communicated right is to see the resulting product. The developer show the product as a proof of the communication.

Time is money. If it proves wrong after several months, ah-oh. It’s wasted time. You don’t want to waste time or money. You want to see the proof early, as early as possible. So the developer wants to, for the sake of a satisfied customer, create only a small chunk of software and show it to yo

研修、トレーニング、ワークショップ 1回(1日) 15万円
function prompt() {
Write-Host "[" -nonewline
Write-Host "$(Get-Location)" -foregroundcolor Cyan -nonewline
Write-Host "]" -nonewline
Write-Host " ${env:USERNAME}@${env:COMPUTERNAME}" -foregroundcolor Magenta
"> "
}
function Add-Path($path) {
if("" -eq $path) {
@yattom
yattom / vending_machine.rb
Last active September 17, 2018 11:52
自動販売機のRubyコードとspecファイル。モブプログラミングでTDDで書いたもの。アジャイルジャパン2017にて / VendingMachine ruby code and spec written in a mob programming session in TDD way at Ajile Japan 2017
# cola/lib/vending_machine.rb
class VendingMachine
attr_reader :dispense_box
attr_reader :refund_box
attr_accessor :zaiko_count
def initialize
@zaiko_count = 1
end
在庫管理システムをモデリングしてください。
以下の機能が必要です。
* 商品ごとに在庫がいくつあるか管理できる
* 出荷時に、倉庫に対して何をいくつ出荷するかピッキングリストを表示する
* 商品の変化(入荷、出荷、移動、など)をすべて記録し、履歴が残る
## ユースケース001
前提: 商品Aが50個在庫している

PLoP(Pattern Language of Programming)のイベントで知ったアイスブレークがあります。

  1. 全員が輪になる
  2. 最初の1人(司会など)がスタートとして、右の人に"tic"、左の人に"toc"という
  3. あとは、以下のルールで伝えていく
    • なにか(ticかtoc)言われたら、"What?"と聞き返す
    • "What?"と右から言われたら、そのまま左に"What?"と流す。左から言われたら右に
    • 2回目になにか(ticかtoc)言われたら、その言葉を次の人に伝える(右から来たら左へ、左から来たら右へ)
  4. ぐるっと回って最初の人までticとtocが伝わったら、おわり