Skip to content

Instantly share code, notes, and snippets.

View atsuya046's full-sized avatar

Nobuya Oshiro atsuya046

View GitHub Profile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/core"
tap "thoughtbot/formulae"
brew "carthage"
brew "ffmpeg"
brew "gist"
brew "mas"
brew "pidcat"
@atsuya046
atsuya046 / setup.md
Last active March 23, 2018 02:38
Setup Mac

Install Homebrew

$ sudo xcodebuild -license

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Java/Kotlin/Scala and more

$ curl -s "https://get.sdkman.io" | bash
@atsuya046
atsuya046 / StateMachine.java
Last active December 29, 2017 09:01
RxJava2 StateMachine
import android.util.Log;
import java.util.HashMap;
import java.util.Map;
import rx.Observable;
import rx.Observable.OnSubscribe;
import rx.Subscriber;
import rx.functions.Action1;
@atsuya046
atsuya046 / MyClass.scala
Last active January 28, 2016 02:48
ScalaCheckで独自のGeneratorを作る ref: http://qiita.com/atsuya046/items/2ab7505336a9f892bc47
case class MyClass(number: Int, multiplier: Multiplier) {
def calc: Int = {
number * multiplier.number
}
}
case class Multiplier(number: Int)
@atsuya046
atsuya046 / Example1.scala
Last active October 13, 2015 03:33
specs2 example
class Core {
def run(): Boolean = {
true
}
}
@atsuya046
atsuya046 / unittest_with_scala.md
Last active August 29, 2015 14:27
ユニットテストのこと。あとspecs2のことも。

ユニットテストする意義

ユニットテストを書こう!http://qiita.com/kompiro/items/78f2c8d2022a685baa83

Maintainability

プロダクションコードの変更時、既存と振る舞いが変わる箇所はテストが失敗する。そのため、変更が影響を及ぼす範囲がわかる

ユニットテストを書くと、コードの振る舞いがテストコードに明示されるため、振る舞いを予測可能な範囲が増える

Design

ユニットテストを書くときは、APIの利用者になるため、APIの利用者から見て利用しやすいコードを目指すモチベーションを産みやすい

@atsuya046
atsuya046 / fizzbuzz.clj
Last active August 29, 2015 14:27
Fizz Buzz with Typed Clojure
(ns fp.match
(:require [clojure.core.match :refer (match)]))
(defprotocol TFizzBuzz
(to-string [this]))
(deftype Fizz [number] TFizzBuzz
(to-string [this] "Fizz"))
(deftype Buzz [number] TFizzBuzz
(to-string [this] "Buzz"))
@atsuya046
atsuya046 / README.md
Last active November 5, 2015 20:09
test_webpack

Install webpack

npm install webpack -g

Build

webpack ./main.js bundle.js
@atsuya046
atsuya046 / simple-http-server.md
Created May 29, 2015 02:45
pythonで簡単にWebサーバを作る

htmlファイルを作成

touch index.html
vi index.html
<h1>Hello World</h1>
@atsuya046
atsuya046 / 0_reuse_code.js
Last active August 29, 2015 14:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console