This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from fabric.api import env, puts, sudo, settings | |
| from fabric.colors import cyan | |
| DOMAIN_LIST = '%s/.ssh/config' % os.environ['HOME'] | |
| env.use_ssh_config = True | |
| env.disable_known_hosts = True | |
| env.password = 'xxxxxx' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sealed abstract class Gender | |
| case object Male extends Gender | |
| case object Female extends Gender | |
| case class Person(name: String, age: Int, gender: Gender) | |
| object CaseMatchExample extends App { | |
| val people = List( | |
| Person("yuu", 25, Male), | |
| Person("mizuki", 27, Female), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setopt prompt_subst | |
| autoload -Uz vcs_info | |
| zstyle ':vcs_info:*' actionformats \ | |
| '%F{5}[%F{2}%b%F{7}:%F{6}%r%F{3}|%F{1}%a%F{5}]%f' | |
| zstyle ':vcs_info:*' formats \ | |
| '%F{5}[%F{2}%b%F{7}:%F{6}%r%F{5}]%f' | |
| zstyle ':vcs_info:*' enable git | |
| vcs_info_wrapper() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def parse_email_from_stdin(): | |
| """標準入力からメールデータを受け取り、解析して | |
| Message オブジェクトにして返す | |
| """ | |
| parser = FeedParser() | |
| for line in sys.stdin: | |
| parser.feed(line) | |
| return parser.close() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| object IncSeq { | |
| def main(args: Array[String]) { | |
| val result = substrLongestIncSeq("333201299823423234") | |
| println(result) // 0129 | |
| } | |
| def substrLongestIncSeq(str: String): String = { | |
| def rec(nums: List[Char], buf: List[Char] = Nil): List[String] = | |
| nums match { | |
| case Nil => Nil |
NewerOlder