Skip to content

Instantly share code, notes, and snippets.

View hryk's full-sized avatar
🏠
Working from home

Hiroyuki Nakamura hryk

🏠
Working from home
View GitHub Profile
@hryk
hryk / auto_validation.rb
Created April 14, 2012 11:28
example code for dm-validations
#!/usr/bin/env ruby
require 'rubygems'
require 'dm-core'
require 'dm-validations'
require 'dm-transactions'
require 'dm-migrations'
require 'dm-types'
class Card
@hryk
hryk / isoelectric_point.js
Created April 19, 2012 12:52
Calculating Isoelectric point of protein sequences.
_ = require('underscore');
EE = require('events').EventEmitter;
ee = new EE();
isoelectric = {};
(function(){
// Constants
var type_p = ['H', 'R', 'K'];
// pk from Bjellqvist, et al.
// Taking into account the decrease in pK differences
// between acids and bases when going from water
set nocompatible
filetype off " for Vundle
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" github repos

splitmbox.pl

2012-05-17T17:58:30

google-email-uploader-mac を使ってThunderbirdのInboxをアップロードしようとしたら、mboxが大きすぎてうまくいかなかったから作った。 Mail::Box::Managerはmbox開く時にロックしたりしていて、特に大きいmboxを開くとものすごく時間がかかるけど一応うまく動いた。

--- ViennaRNA-2.0.7/Makefile.in 2012-06-15 10:39:46.000000000 +0900
+++ ViennaRNA-2.0.7/Makefile.in.new 2012-06-15 10:26:15.000000000 +0900
@@ -830,8 +830,7 @@
info-am:
-install-data-am: install-dist_docDATA install-dist_docdir_htmlDATA \
- install-docDATA install-docdir_htmlDATA install-pkgconfigDATA \
+install-data-am: install-docDATA install-docdir_htmlDATA install-pkgconfigDATA \
install-pkgdataDATA
@hryk
hryk / SConstruct
Created June 18, 2012 05:09
日本語のTeX文書をsconsでビルドする。
import os
env = Environment(ENV=os.environ)
env.Replace(LATEX='platex')
env.Replace(LATEXFLAGS='-interaction=nonstopmode')
env.Replace(DVIPDF='dvipdfmx')
env.Replace(DVIPDFCOM='cd ${SOURCE.dir} && $DVIPDF $DVIPDFFLAGS -o ${TARGET.file} ${SOURCE.file}')
env.DVI(target='src/doc.dvi', source='src/doc.tex')
env.PDF(target='doc.pdf', source='src/doc.dvi')
nova dns-create-public-domain --project hogeproject hoge.com
| dns_domains | CREATE TABLE `dns_domains` (
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
`deleted` tinyint(1) DEFAULT NULL,
`domain` varchar(512) CHARACTER SET latin1 NOT NULL,
`scope` varchar(255) DEFAULT NULL,
`availability_zone` varchar(255) DEFAULT NULL,
@hryk
hryk / protparam.rb
Created August 22, 2012 15:15
Bio::Tools::Protparam for BioRuby
# encoding: utf-8
#
# Bio::Tools::Protparam Copyright (C) 2012 hryk <[email protected]>
#
# This library is free software; you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.1 of the License, or (at your option)
# any later version.
#
# This library is distributed in the hope that it will be useful, but WITHOUT
@hryk
hryk / second_code.py
Created September 17, 2012 14:37
tea break
# coding: utf-8
from copy import copy
class SimpleBars(object):
def __init__(self,arg):
""" Initializing a sequence as list """
self.current = [c for c in arg]
def apply_rules(self):
""" Applying rules to current sequence """
# Rule1:
#!/usr/bin/env ruby
require 'pp'
class Foo
IUPAC_CODE = {
:I => "Ile",
:V => "Val",
:L => "Leu",
:F => "Phe",
:C => "Cys",