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
# tmux 1.3
set-window-option -g utf8 on
set-window-option -g mode-keys vi
#
set-option -g prefix C-q
set-option -g default-path /Users/hiroyuki/Develop/
set-option -g default-command "reattach-to-user-namespace -l zsh"
unbind-key C-b
bind-key C-q send-prefix
set-option -g detach-on-destroy
@hryk
hryk / monitor_ds.py
Created November 28, 2012 13:03
任天堂製品がいるとGrowlで通知する。
#!/usr/bin/env python
import re
import string
import sets
import sys
import urllib2
import os.path
import subprocess
from gntp.notifier import mini
@hryk
hryk / enc_1.9.rb
Created October 23, 2012 17:24
enc method in related.rb
def enc(s)
encoded = []
s.bytes {|i|
if i < 0x80
encoded << i.chr(Encoding::ASCII)
else
encoded << '%'+i.chr(Encoding::ASCII_8BIT).unpack('H2').join('')
end
}
encoded.join('')
@hryk
hryk / setup.py
Created October 22, 2012 12:28
an example for using boost::unordered_map in Cython.
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [
Extension("test_um",
["test_um.pyx"],
include_dirs=["/usr/local/include/boost"],
library_dirs=["/usr/local/lib"],
language="c++")
#!/usr/bin/env ruby
require 'pp'
class Foo
IUPAC_CODE = {
:I => "Ile",
:V => "Val",
:L => "Leu",
:F => "Phe",
:C => "Cys",
@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:
@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 <hello@hryk.info>
#
# 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
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 / 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')
--- 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