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
const p = (s, n) => { | |
const r = [] | |
for (let i = 1; i <= s; i++) { | |
if (i < n - 5) { | |
if (i == 1) r.push(i) | |
continue | |
} else if (i > n + 5) { | |
if (i == s) r.push(i) | |
continue | |
} else if (i == n + 5) { |
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
const func = (type) => { | |
if (type == 'foo') { | |
// ... | |
} else { // type == 'bar' | |
// ... | |
} | |
// ... | |
// ... | |
if (type == 'foo') { | |
// ... |
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 SmartString { | |
def get: String | |
} | |
class RawString(val original: String) extends SmartString { | |
def get: String = original | |
} | |
class HtmlString[T <: SmartString](val original: T) extends SmartString { | |
lazy val escapedString = original.get |
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
javascript:(function(s,k,v,w){v=s.getItem(k)||"";w=prompt(k,v);if(w!=null)s.setItem(k,w)})(localStorage,"$Memo> "+location.href) |
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
\begin{CD} | |
\textbf{D} @>\mathcal{F^\dagger E}>> \textbf{U} \\ | |
@A\mathcal{F}AA \phantom{\eta}\Big\Uparrow\eta @VV\mathcal{id}_\textbf{U}V \\ | |
\textbf{C} @>\mathcal{E}>> \textbf{U} \\ | |
\end{CD} |
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
type Pair[A] = (A, A) | |
type Tree[A] = Freer[Pair, A] | |
def leaf[A](a: A): Tree[A] = Pure(a) | |
def node[A](x: Tree[A], y: Tree[A]): Tree[A] = Freer((x, y): Pair[Tree[A]]) |
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
List[A] // A 型のリスト | |
Future[A] // 将来 A 型の値を保持する何らかの処理 | |
Option[A] // A 型の値を保持または何も保持していない状態を表す型 | |
type Pair[A] = (A, A) // A 型 の値のペア | |
type Const[A] = Unit // (型 A に依らず) 常に同じ値を持つ型 | |
type Reader[E, A] = E => A // E 型の値を受け取り A 型の値を返す関数 | |
type AtoX[A, X] = A => X // A 型 の値を受け取り X 型の値を返す関数 | |
type Cont[A, R] = (A => R) => R // A 型 の値を受け取り R 型の値を返す関数 を受け取り R 型の値を返す関数 | |
type Catch[A, X, Y] = ((A => X) => Y) => Option[A] // A 型 の値を受け取り X 型の値を返す関数 を受け取り Y 型の値を返す関数 を受け取り Option[A] 型の値 を返す関数 |
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
"use strict"; | |
import StateMachine from "javascript-state-machine" | |
/* | |
* waiting | running | finished | |
* ------------|------------*-----------------|------------ | |
* `startTime `currentTime `endTime | |
*/ |
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
bundle exec rubocop | |
cop=$? | |
bundle exec rspec spec | |
pec=$? | |
exit $(($cop || $pec)) |
NewerOlder