This file contains 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
source 'http://rubygems.org' | |
gem 'guard' | |
gem 'guard-less' | |
gem 'guard-coffeescript' |
This file contains 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 | |
# -*- coding: utf-8 -*- | |
require 'nokogiri' | |
require 'stringio' | |
require 'open-uri' | |
begin | |
require 'rainbow' | |
rescue LoadError |
This file contains 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 scala.util.matching.Regex | |
class StringValidator(strings: List[String]) { | |
var or = false | |
var not = false | |
var result = true | |
def judge = result | |
def and = self(or = false) |
This file contains 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 Vector[V <: Vector[V]] extends Product { | |
def +(vector: V): V | |
def *(vector: V): V | |
def *(coefficient: Double): V | |
def toList: List[Double] | |
def innerProduct(vector: V) = (this * vector).toList.reduceLeft(_ + _) | |
} | |
case class Vector1D(_1: Double) extends Vector[Vector1D] { |
This file contains 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
(function($) { | |
$(document).on('mousemove', function mousemove() { | |
// 動かしたり | |
}); | |
$(document).on('mouseup', function mouseup() { | |
$(this).off('mouseup', mouseup); // こっちはOK | |
$(this).off('mousemove', mousemove); // こっちが参照出来ない | |
}); | |
})(jQuery); |
This file has been truncated, but you can view the full file.
This file contains 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 Matrix | |
trait SquareMatrix[M <: SquareMatrix[M]] { | |
def inverse(): Option[M] | |
} | |
trait Rows1 | |
trait Rows2 | |
trait Rows3 | |
trait Rows4 |
This file contains 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
# -*- coding: utf-8 -*- | |
OFFENCE = 150 # 自分の攻コスに変更 | |
DEFENCE = 150 # 自分の守コスに変更 | |
# 手持ちのアイドルを並べてく | |
IDOLS = [ | |
['[孤高の歌姫] 如月千早+', 13516, 10972, 14], # [名前, 攻, 守, コスト] の順で書く | |
['[麗しの花嫁] 和久井留美+', 8891, 6416, 10], | |
['[博識子女] 古澤頼子+', 10493, 10493, 12], |
This file contains 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
# 1. src/**/*.txtにマッチするファイル(例: src/hello/goodbye.txt)を探し | |
# 2. マッチしたファイルを:targetオプションに指定した方法で目的のファイル名(例: work/hello/goodbye.normalized.txt)を求め | |
# 3. `file 目的のファイル名 => マッチしたファイル名`というタスクを作る | |
# | |
# ってことがしたい。ちなみにgenerate_fromの返り値は目的のファイル名の一覧 | |
work_files = generate_from 'src/**/*.txt', :target => ['work', :dirname, :filename, '.normalized.txt'] do |t| | |
sh "./normalize #{t.from} #{t.to}" # ./normalize-text-file src/hello/goodbye.txt work/hello/goodbye.normalized.txt | |
end | |
# 直前のタスクの定義で得たファイル名の一覧を使ってさらにタスクを定義したり |
This file contains 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 escript | |
main([Query|_]) -> | |
case matcher(Query) of | |
{ok, Matcher} -> | |
print(lists:filter(Matcher, http_statuses())); | |
{error, {Message, Position}} -> | |
io:format("Error: ~s at ~p character~n", [Message, Position]) | |
end; |
This file contains 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
puts 1 | |
puts %w(hello world) * ' ' | |
puts %w(h l t).join('igh') |