Skip to content

Instantly share code, notes, and snippets.

Feature: Basic communication
Background:
Given mimibot logs into Twitter as "mickey24_bot"
Scenario: No reaction if no mention
Given there's no mention to mimibot on Twitter
When mimibot runs
Then mimibot gets mentions from Twitter
And mimibot does nothing
@mickey24
mickey24 / .vimrc
Created August 12, 2012 14:23
.vimrc
" $HOME/.vimrc
" MyAutoCmd : an augroup for my autocmd {{{1
augroup MyAutoCmd
autocmd!
augroup END
" Encoding {{{1
scriptencoding utf-8
set encoding=utf-8
# -*- coding: utf-8 -*-
require "open-uri"
require "json"
require "pp"
###
# loading bullet
###
@mickey24
mickey24 / convert_fukushima.rb
Created March 14, 2011 16:18
奥村先生による福島原発のデータ fukushima*.csv ( http://oku.edu.mie-u.ac.jp/~okumura/stat/data/ ) をRなどで処理しやすい形に加工するスクリプトです.使い方についてはコメント欄を参照してください.
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "time"
puts %w[datetime mon day hour min place gamma neutron wind_dir wind_speed].join("\t")
lines = ARGF.each_line.to_a[2..-1]
date = ""
lines.each do |line|
@mickey24
mickey24 / bitly.rb
Created February 24, 2011 15:03
shorten a URL by bit.ly API ( http://bit.ly/hKSXnN )
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
require "net/http"
require "cgi"
require "nkf"
require "json"
class Bitly
def initialize(account, api_key)
# -*- coding: utf-8 -*-
i = 0
ARGF.each_char do |c|
printf "\x1b[3#{(i += 1) % 6 + 1}m#{c}"
end
print "\x1b[39m"
@mickey24
mickey24 / quine.rb
Created January 30, 2011 14:43
Quine in Ruby
str = "str = %c%s%c; printf str, 34, str, 34"; printf str, 34, str, 34
@mickey24
mickey24 / udonge_quine.rb
Created September 15, 2010 11:02
udone_quine.rb
eval$s =%w'
b= " BAhsKwG
vfg A AAAAA PAAA
AIw AA AAA gD8AAAA4
AQA AA Ph 4AAAAcAMAA
ICDf wA A AOAGAADA8D8
AAAD wB g AAQPwfAAAA
eAY AA E D/AwAAA
DgGA AB A fwAAAAA
8DAAA QH 8 AAA AAf
@mickey24
mickey24 / mpl_brainfuck.cc
Created September 9, 2010 12:29
A Brainf*ck interpreter using Boost.MPL
#include <iostream>
// change this parameter according to the length of your program
#define BOOST_MPL_LIMIT_STRING_SIZE 128
#include <boost/mpl/at.hpp>
#include <boost/mpl/comparison.hpp>
#include <boost/mpl/erase.hpp>
#include <boost/mpl/equal.hpp>
#include <boost/mpl/insert.hpp>
@mickey24
mickey24 / nearest_gene.cc
Created August 21, 2010 09:53
二つの遺伝子発現データを比較し,発現領域が近い遺伝子のペアを出力する.#DBCLS
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
using namespace std;
// 遺伝子発現領域データ用構造体