Skip to content

Instantly share code, notes, and snippets.

View numa08's full-sized avatar
🐍

Takaya Funabiki numa08

🐍
View GitHub Profile
@numa08
numa08 / googru.sh
Created August 17, 2013 14:12
ぐぐるやつ
#!/bin/sh
if [ -z ${GOOGLE_CMD} ];then echo GOOGLE_CMD is not defined; echo 'let do(mac,bash) \"export GOOGLE_CMD=open\"'; exit 1; fi; query=""; for q in $*; do query=`echo ${query}"+"${q}`; done; ${GOOGLE_CMD} http://google.com/search?q=${query};
@numa08
numa08 / val_is_not_final.kt
Created June 6, 2016 09:27
val_is_not_final.kt
fun failedSuruyo() {
throw Exception("error")
}
fun main(args: Array<String>) {
val res : String
try {
res = "succedd"
failedSuruyo()
private InputFilter mEmojiFilter = (source, start, end, dest, dstart, dend) -> {
if (source.length() == 0) {
return source;
}
// 入力された1文字が2バイト以上の物について、絵文字かどうか判断をする。
// UTF-8 の絵文字の文字コードについては、 Wikipedia を参照した
// https://en.wikipedia.org/wiki/Emoji#Unicode_blocks
final int codePoint = Character.codePointAt(source, 0);
if (
(codePoint >= 0x1F300 && codePoint <= 0x1F5FF ) ||
implicit class View2Opt(val view : View) extends AnyVal{
def asOpt[T <: View](implicit tag : ClassTag[T]) : Option[T] = {
view match {
case v : T => Some(v)
case _ => None
}
}
}
val title = Option(getArguments()).map(_.getInt("title"))
@numa08
numa08 / HatenaFeed.scala
Created January 16, 2014 15:53
Scalaサイコー!!
import org.scaloid.common._
import scala.concurrent.future
import scala.concurrent.ExecutionContext.Implicits.global
import scala.io.Source
import org.json4s._
import org.json4s.native.JsonMethods._
class HatenaFeed extends SActivity{
onCreate{
@numa08
numa08 / kawaii.scala
Created January 9, 2014 16:16
Dejiko in Scala
import scala.collection.mutable.ArrayBuffer
object Kawaiidsl extends App {
class Wepon(val name : String) {
var fromPart : String = _
def from(part: String) : Wepon = {
fromPart = part
this
@numa08
numa08 / git-count-chart.sh
Created December 18, 2013 14:11
git-count4chart
wget -O chart.png $(printf "http://chart.apis.google.com/chart?cht=bvs&chs=100x50&chd=t:%s" $(git count ./ | awk -v ORS="" 'NR>1&&/^[a-zA-Z0-9]/{print $2","}') | awk '{sub(/.$/, "", $1); print $1}')
@numa08
numa08 / neo.java
Last active December 30, 2015 21:59
ねおさんへ♡
public enum FaceNameEye {
Mabataki("まばたき"),
Warai("笑い"),
Wink_L("ウインク"),
Wink_l2("ウインク2"),
final String name;
FaceNameEye(String name) {
this.name = name;
# 各商品の合計値と設定価格の差を格納するクラス。
# このオブジェクトのリストを生成し、差分の少ない
# 順にソートを行うことで、設定価格に最も近く最も大
# きい値を求める
class Total
attr_reader :value, :difference
def initialize(value, difference)
@value = value
@difference = difference
end
@numa08
numa08 / _scalaza_05.md
Last active December 26, 2015 00:29
新宿Scala座第5回

JenkisとPlayFramework



@numa08

http://numa08.net