Skip to content

Instantly share code, notes, and snippets.

print "\n".join([("fizz" if i%3<1 else "")+("buzz" if i%5<1 else "") for i in range(1,31)])
@y-matsuwitter
y-matsuwitter / fizzbuzz.scm
Created November 25, 2011 08:09
fizzbuzz for scheme
(use srfi-1)
(define (f n)
(for-each print
(map
(lambda (x) (cond ((= (modulo x 15) 0) "FizzBuzz")
((= (modulo x 5) 0) "Buzz")
((= (modulo x 3) 0) "Fizz")
(else x)))
(iota n 1))))
(f 100)
@y-matsuwitter
y-matsuwitter / Makefile
Created December 8, 2011 05:12
Makefile for my javascript
DIST_DIR = ../js
BASE_DIR = .
BASE_FILES = store.js\
models.js\
collection.js\
router.js\
views.js
INDEX_MODULES = ${BASE_DIR}/index_header.js\
${BASE_FILES}\
@y-matsuwitter
y-matsuwitter / xcode4shortcut.md
Created December 4, 2012 14:24 — forked from dnpp73/xcode4shortcut.md
Xcode 4 でdんっpがよく使うショトカまとめ

作業エリアのショトカなど


  • 左のエリアのアレ切り替え
    Cmd + [0-7]

  • 右のエリアのアレ切り替え
    Cmd + Option + [0-2]

  • 右のエリアのアレ切り替えその二

@y-matsuwitter
y-matsuwitter / file0.txt
Created December 11, 2012 01:56
UIImageを様々なtypeのcv::Matへ変換したい時の単純な方法 ref: http://qiita.com/items/f3543dafa3a0a776c252
@interface UIImage(OpenCVUtility)
- (cv::Mat)cvMat;
@end
@implementation UIImage (OpenCVUtility)
-(cv::Mat)CVMat
{
CGColorSpaceRef colorSpace = CGImageGetColorSpace(self.CGImage);
CGFloat cols = self.size.width;
CGFloat rows = self.size.height;
@y-matsuwitter
y-matsuwitter / file0.txt
Created December 12, 2012 17:19
ofxOpenNIのセットアップ ref: http://qiita.com/items/b9b2d84949f6549a8383
cd /path/to/openFrameworks/addons/
git clone https://github.com/gameoverhack/ofxOpenNI.git
cd ofxOpenNI
git checkout master
cd ..
@y-matsuwitter
y-matsuwitter / file0.txt
Created December 15, 2012 02:53
Rails3.2Engineのコントローラーのspecについて ref: http://qiita.com/items/b845691b122a25260c08
get 'index'
require 'active_support/core_ext'
require 'open-uri'
hash = Hash.from_xml open('http://hoge.com/ext/data.xml').read
json = hash.to_json
@y-matsuwitter
y-matsuwitter / file0.txt
Created December 17, 2012 08:56
Rails3 Engineのroutes.rbでの注意 ref: http://qiita.com/items/7444157c996de26f5e28
MyEngine::Engine.routes.draw do
get "hoge/index"
end
cd <Project Directory>
git submodule add git://github.com/jverkoey/nimbus.git
cd nimbus
git submodule init
git submodule update