Skip to content

Instantly share code, notes, and snippets.

View ursm's full-sized avatar

Keita Urashima ursm

View GitHub Profile
ursm / parse_st.rb
Last active March 14, 2016 12:37 — forked from tfuji/parse_st.rb
INSDC structured comment parser
#!/usr/bin/env ruby
require 'rubygems'
require 'bio'
def parse_st_comment(comment)
comment.scan(/##(.+)-START##\n(.*)\n##\1-END##/m).each_with_object({}) {|(tagset, block), memo|
i = 0
memo[tagset] = block.lines.chunk {|line|
ursm / 0_reuse_code.js
Created May 5, 2014 21:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
history = []
puts 'Hello! May I help you?'
while words = gets.chomp
history << words
break if history.last(3) == %w(BYE BYE BYE)
case words
ken = 'けん'
prefixes = %w(さん くん ちゃん)
while (ken + (prefix = prefixes.sample)).size < 140
ken << prefix
puts ken + '…'
ursm / User.rb
Created April 20, 2012 14:43 — forked from kenchan/User.rb
class User < ActiveRecord::Base
presence: true,
format: {with: VALID_EMAIL_REGEX},
uniqueness: {case_sensitive: false}
class User < ActiveRecord::Base
require 'spec_helper'
module BowlongGameMacro
class BowlongGamePlayer
def initialize
@game =
def roll_spare
ursm / world
Created March 18, 2010 14:45 — forked from kenchan/world
# world 外のパッケージを手動で remerge するときは emerge -av1 nss みたいにすると world に記録されなくていいですよ
# USE=hal で emerge -avN world すれば勝手に入るはず
# 最近は mlocate の方がいいらしいです
# emerge -av @module-rebuild で
ursm / Gemfile
Created February 13, 2010 20:02 — forked from indirect/Gemfile
# include at least one source and the rails gem
source :gemcutter
gem 'rails', '~> 2.3.5', :require => nil
group :development do
# bundler requires these gems in development
gem 'rails-footnotes'
group :test do
ursm / gist:274806
Created January 12, 2010 02:14 — forked from kamal/gist:269412
require "rack/openid"
require "warden"
use Rack::OpenID
use Warden::Manager do |manager|
Warden::Strategies.add(:openid) do
def authenticate!
if resp = env["rack.openid.response"]
case resp.status
when :success
development: &global_settings
database: textual_development
port: 27017
database: textual_test
<<: *global_settings