Skip to content

Instantly share code, notes, and snippets.

View sifue's full-sized avatar

Soichiro Yoshimura sifue

View GitHub Profile
@sifue
sifue / study3.hs
Created November 11, 2014 11:22
Haskell勉強会宿題
-- (1)
manlen :: (Int, Int) -> (Int, Int) -> Int
manlen (a, b) (c, d) = abs(a - c) + abs(b - d)
-- (2)
points :: Int -> [(Int, Int)]
points x = [ (a, b) | a <- [(-1 * x)..x], b <-[(-1 * x)..x]]
-- (3)
mancircle :: Int -> [(Int, Int)]
mancircle x = [(a, b) | (a, b) <- points(x), manlen (0, 0) (a, b) == x]
@sifue
sifue / file0.txt
Last active August 29, 2015 14:11
SlackとIRCを相互リレーする話 ref: http://qiita.com/sifue/items/4fd6efee608da0cc849d
git clone [email protected]:sifue/ircslackrelay.git
cd ircslackrelay
sbt assembly
@sifue
sifue / LoL初心者を脱するために覚えること.md
Last active February 28, 2025 23:23
LoL初心者を脱するために覚えること

LoL初心者を脱するために覚えること

ゲーム前にすること

  • プロの試合のミニマップを見る
  • probuildsでプロのビルドを見て最近のメタを知し、ビルドやマスタリーを真似る
  • 各チャンピオンの強い時間帯を知る
  • 自分が得意なレーンを知る (top/mid/jungle/adc/support)
  • 使うチャンプのスキルのAP/ADレシオを確認する
  • 使うチャンプ/仲間のチャンプのパッシブを理解する
  • チームの穴を埋めるようなピック、特に足りないタンクやハードCC、ダメージ、スキルのシナジーを考える
  • 勝負に対する自分の影響を高めたいなら率先してMidかJungleをやる
@sifue
sifue / MainBefore.scala
Last active August 29, 2015 14:15
ScalaでどのタイミングでNoneが生じたか返すコードをEitherを使ってスッキリ書くリファクタリング ref: http://qiita.com/sifue/items/7009f6ebe36f359865dc
object MainBefore {
case class Address(id: Int, name: String, postalCode: Option[String])
case class User(id: Int, name: String, addressId: Option[Int])
val userDatabase: Map[Int, User] = Map (
1 -> User(1, "太郎", Some(1)),
2 -> User(2, "二郎", Some(2)),
3 -> User(3, "プー太郎", None)
)
@sifue
sifue / file0.scala
Created March 4, 2015 04:44
sbtまたはactivator内で-featureをコンパイルオプションにつけるコマンド ref: http://qiita.com/sifue/items/5ddde7d6439b6207241d
sbt> set scalacOptions += "-feature"
@sifue
sifue / file0.js
Last active August 29, 2015 14:17
JavaScriptのPromiseとScalaのPromiseは別物で、むしろScalaのFutureが似てる話 ref: http://qiita.com/sifue/items/4a003ce1edd519076546
function doubleUp(value) {
return value * 2;
}
function increment(value) {
return value + 1;
}
function output(value) {
console.log(value);
}
var promise = new Promise(function (resolve) {
@sifue
sifue / file0.js
Last active July 15, 2020 00:38
Slackで特定の名前を持つボットやユーザーをミュートするブックマークレット ref: http://qiita.com/sifue/items/c53ec647ffe2f17fb149
javascript:(function(){$("#msgs_div").on('DOMSubtreeModified propertychange', function() {$("div.message > *.message_sender:contains(slackbot)").parent().hide();});})();
@sifue
sifue / file0.sql
Last active August 29, 2015 14:27
MySQL InnoDBの介在する大規模サービスにおけるID生成戦略について ref: http://qiita.com/sifue/items/c9192726bdce4b4a6dd7
create table `user_relations` (
`from_user_id` int NOT NULL,
`to_user_id` int NOT NULL,
`from_user_id_dummy` VARCHAR(124) NOT NULL,
`to_user_id_dummy` VARCHAR(124) NOT NULL,
`created_time` DATETIME NOT NULL,
PRIMARY KEY (`from_user_id`, `to_user_id`),
INDEX `relation_index_created_time` (`from_user_id`, `to_user_id`, `created_time` )
) ENGINE=InnoDB DEFAULT CHARACTER SET=latin1
@sifue
sifue / file0.java
Last active September 13, 2015 07:01
DDDに役立つScalaの関数型プログラミング的機能 ref: http://qiita.com/sifue/items/8618eba5e48bd8063813
public interface User {
public LotResult lot();
public class Present {}
public interface LotResult {
public Present present();
}
public class Hit implements LotResult {
public Present present() { return new Present();}
}
public class Blank implements LotResult {
@sifue
sifue / es6_study.html
Created September 11, 2015 06:50
ES6練習
<!DOCTYPE html>
<html lang="ja-jp">
<head>
<meta charset="UTF-8">
<title>ES6練習</title>
</head>
<body>
<script>
(function(){
'use strict';