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
| # for rspec1.3.1 | |
| require 'benchmark' | |
| module Spec | |
| module Example | |
| module ExampleGroupMethods | |
| # alias_method :orig_run, :run | |
| MODEL_DIR = File.join(RAILS_ROOT, "app/models") |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'uri' | |
| require 'net/http' | |
| require 'json' | |
| class Kawaii | |
| KAWAII_HOSTNAME = "kawaii-search.jp" | |
| KAWAII_URI = "/search/kwData.php?q=%s&category=%s&num=%d&offset=%d" |
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
| ᘀᘐᘠᘰᙀᙐᙠᙰᘁᘑᘡᘱᙁᙑᙡᙱᘂᘒᘢᘲᙂᙒᙢᙲᘃᘓᘣᘳᙃᙓᙣᙳᘄᘔᘤᘴᙄᙔᙤᙴᘅᘕᘥᘵᙅᙕᙥᙵᘆᘖᘦᘶᙆᙖᙦᙶᚆᘇᘗᘧᘷᙇᙗᙧᘈᘘᘨᘸᙈᙘᙨᘉᘙᘩᘹᙉᙙᙩᘊᘚᘪᘺᙊᙚᙪᘋᘛᘫᘻᙋᙛᙫᘌᘜᘬᘼᙌᙜᙬᘍᘝᘭᘽᙍᙝ᙭ᘎᘞᘮᘾᙎᙞ᙮ᘏᘟᘯᘿᙏᙟᙯᔀᔐᔠᔰᕀᕐᕠᕰᖀᖐᖠᖰᗀᗐᗠᗰᔁᔑᔡᔱ | |
| ᕁᕑᕡᕱᖁᖑᖡᖱᗁᗑᗡᗱᔂᔒᔢᔲᕂᕒᕢᕲᖂᖒᖢᖲᗂᗒᗢᗲᔃᔓᔣᔳᕃᕓᕣᕳᖃᖓᖣᖳᗃᗓᗣᗳᔄᔔᔤᔴᕄᕔᕤᕴᖄᖔᖤᖴᗄᗔᗤᗴᔅᔕᔥᔵᕅᕕᕥᕵᖅᖕᖥᖵᗅᗕᗥᗵᔆᔖᔦᔶᕆᕖᕦᕶᖆᖖᖦᖶᗆᗖᗦᗶᔇᔗᔧᔷᕇᕗᕧᕷᖇᖗᖧᖷᗇᗗᗧᗷᔈᔘᔨᔸᕈᕘᕨᕸᖈᖘᖨᖸᗈᗘᗨᗸᔉᔙᔩᔹᕉᕙᕩᕹᖉᖙᖩᖹᗉᗙᗩᗹ | |
| ᔊᔚᔪᔺᕊᕚᕪᕺᖊᖚᖪᖺᗊᗚᗪᗺᔋᔛᔫᔻᕋᕛᕫᕻᖋᖛᖫᖻᗋᗛᗫᗻᔌᔜᔬᔼᕌᕜᕬᕼᖌᖜᖬᖼᗌᗜᗬᗼᔍᔝᔭᔽᕍᕝᕭᕽᖍᖝᖭᖽᗍᗝᗭᗽᔎᔞᔮᔾᕎᕞᕮᕾᖎᖞᖮᖾᗎᗞᗮᗾᔏᔟᔯᔿᕏᕟᕯᕿᖏᖟᖯᖿᗏᗟᗯᗿ᐀ᐐᐠᐰᑀᑐᑠᑰᒀᒐᒠᒰᓀᓐᓠᓰᐁᐑᐡᐱᑁᑑᑡᑱᒁᒑᒡᒱᓁᓑᓡᓱᐂᐒᐢᐲᑂᑒᑢᑲᒂᒒᒢᒲ | |
| ᓂᓒᓢᓲᐃᐓᐣᐳᑃᑓᑣᑳᒃᒓᒣᒳᓃᓓᓣᓳᐄᐔᐤᐴᑄᑔᑤᑴᒄᒔᒤᒴᓄᓔᓤᓴᐅᐕᐥᐵᑅᑕᑥᑵᒅᒕᒥᒵᓅᓕᓥᓵᐆᐖᐦᐶᑆᑖᑦᑶᒆᒖᒦᒶᓆᓖᓦᓶᐇᐗᐧᐷᑇᑗᑧᑷᒇᒗᒧᒷᓇᓗᓧᓷᐈᐘᐨᐸᑈᑘᑨᑸᒈᒘᒨᒸᓈᓘᓨᓸᐉᐙᐩᐹᑉᑙᑩᑹᒉᒙᒩᒹᓉᓙᓩᓹᐊᐚᐪᐺᑊᑚᑪᑺᒊᒚᒪᒺᓊᓚᓪᓺᐋᐛᐫᐻᑋᑛᑫᑻ | |
| ᒋᒛᒫᒻᓋᓛᓫᓻᐌᐜᐬᐼᑌᑜᑬᑼᒌᒜᒬᒼᓌᓜᓬᓼᐍᐝᐭᐽᑍᑝᑭᑽᒍᒝᒭᒽᓍᓝᓭᓽᐎᐞᐮᐾᑎᑞᑮᑾᒎᒞᒮᒾᓎᓞᓮᓾᐏᐟᐯᐿᑏᑟᑯᑿᒏᒟᒯᒿᓏᓟᓯᓿ |
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 Glyphs extends App { | |
| val n = args.headOption.map{_.toInt}.getOrElse(140) | |
| scala.io.Codec.toUTF8 ((1 to n).map{_ => (util.Random.nextInt(629) + 5121).toChar}).foreach{b => java.lang.System.out.write(b)} | |
| } |
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
| /** | |
| * 謎言語ウキャス | |
| * こんにちわ → ᓦᐓᔦᐓᓾᐓᓴᐓᔢᐓ | |
| * 吾輩は猫である。名前はまだ無い。 → ᗟᐡᓢᐹᔂᐓᑙᐮᓺᐓᓕᐓᔞᐓ。ᖮᐡ᙭ᐠᔂᐓᔑᐓᓳᐓᓎᐭᓗᐓ。 | |
| * 謎言語ウキャスは、@yuroyoroがScalaでテキトーに10分くらいで実装しました。 | |
| * → ᗅᐷᒷᐷᕕᐷᔹᐓᕀᐓᕶᐓᕌᐓᔂᐓ、@yuroyoroᓟᐓScalaᓺᐓᕙᐓᕀᐓᕛᐓᖏᐓᓾᐓ10ᘦᐠᓢᐓᔜᐓᓗᐓᓺᐓᗃᐤᗻᐶᓪᐓᔑᐓᓪᐓᓲᐓ。 | |
| * | |
| */ | |
| object UCAS extends App{ | |
| import java.text.Normalizer |
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 Main extends App { | |
| trait Reversible { | |
| val s:String | |
| def reverseOrder = s reverse | |
| def reverseCases = s collect{ | |
| case c if c.isUpper => c.toLower | |
| case c if c.isLower => c.toUpper | |
| case c => c | |
| } |
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 Pypi extends App { | |
| val os = Seq("おっ", "オッ", "オッ", "O", "o") | |
| val ps = Seq("Py", "py", "ぱい", "パイ", "パイ") | |
| def choice[A](xs:Seq[A]):A = xs(util.Random.nextInt(xs.length)) | |
| def oppy = choice(os) * util.Random.nextInt(2) + choice(ps) | |
| Stream.continually(oppy).flatten take(140) mkString | |
| } |
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
| trait TupleOps[A,B,C] { | |
| val tuple:(A,B,C) | |
| def head:A = tuple._1 | |
| def tail:(B,C) = (tuple._2, tuple._3) | |
| } | |
| implicit def tupleOps[A,B,C](t:(A,B,C)) = new TupleOps[A,B,C]{ val tuple = t } |
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
| #!/bin/sh | |
| # usage: | |
| # git back でひとつ前に居たbranchに戻る | |
| # git back N でN個前に戻る | |
| # git back --listで履歴だす | |
| # | |
| # /usr/local/libexec/git-coreに置いてchmod +xしとけ | |
| CNT=1 |
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
| ozaki@mbp-4 $ scala [~] | |
| Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8 | |
| Welcome to Scala version 2.9.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). | |
| Type in expressions to have them evaluated. | |
| Type :help for more information. | |
| scala> def ?! = throw new UnsupportedOperationException("“事故“る奴は・・・・“不運” (ハードラック )と“踊”(ダンス )っちまったんだよ・・・・") | |
| $qmark$bang: Nothing | |
| scala> ?! |