Skip to content

Instantly share code, notes, and snippets.

View Wintus's full-sized avatar
📡
on the ground

wint Wintus

📡
on the ground
  • Tokyo
  • 11:40 (UTC +09:00)
  • X @wint7
View GitHub Profile
@mariussoutier
mariussoutier / Mail.scala
Created August 23, 2012 12:13
Sending mails fluently in Scala
package object mail {
implicit def stringToSeq(single: String): Seq[String] = Seq(single)
implicit def liftToOption[T](t: T): Option[T] = Some(t)
sealed abstract class MailType
case object Plain extends MailType
case object Rich extends MailType
case object MultiPart extends MailType
@malandrina
malandrina / gist:3744867
Created September 18, 2012 18:26
Implementing a Reverse Polish Notation Calculator in Ruby

Implementing a Reverse Polish notation calculator in Ruby

A couple weeks ago I had a go at implementing an RPN calculator in Ruby. I knew I wanted the calculator to function by popping operands out of an array populated with the values of the input expression, operating upon the operands with the appropriate operator, and pushing the result back into the stack of operands.

I was able to implement this in version 1, but it took forever and the resulting code was not very beautiful. Why?

  • I started coding before I had a thorough understanding of RPN

    Wait, 20 10 5 4 + * - is what now?

@seizans
seizans / persistent.md
Created December 10, 2012 15:21
Haskellで便利にデータ設計

Haskellで便利にデータ設計

概要

これは [Haskell Advent Calendar 2012][] の11日目の記事です。
Haskell でデータ設計を便利に行う発想・方法について書きました。
[persistent][] というライブラリを活用します。
Haskell を知らなくても読めます。
主な対象読者は [プログラミングHaskell][] か [すごいHaskellたのしく学ぼう!][] を読み、Haskell をより使いたい人です。

@repeatedly
repeatedly / msgpack_issue_121.md
Last active November 30, 2021 02:09
MessagePackが文字列とバイナリをわけないのは問題?

MessagePackが文字列とバイナリをわけないのは問題?

msgpack/msgpack#121

Objective Cの実装使ってるとある問題にぶちあたった.なので,文字列をちゃんとバイナリ(Raw)と分けるべき,という提案

(*) 俺は熟読したわけではないので,中身が気になる人はちゃんと本スレを読みましょう

そもそもMessagePackとは

@ryo-murai
ryo-murai / scalatest-matcher.md
Last active February 24, 2021 02:13
Matchers in scalatest

Matchers in scalatest

scalatestでは a should be (b)のように、「検査対象の値が〜であること」(この例では「abであること」)という書き方をする。 「〜である」を指定する方法(Matcherと呼ぶ)がいくつかあるので簡単にまとめてみる

等価性(equality)

  • 上記の例のように be の後の()の中に期待値を書く。 name should be ("scala")
  • be の代わりに equal も使える。
@ympbyc
ympbyc / FunctionOriented.md
Last active March 14, 2019 08:33
LLerのための関数指向入門

LLerのための関数指向入門

2013 Minori Yamashita [email protected]

ターゲットを動的オブジェクト指向プログラマに絞って、関数指向の考え方を説明します。 コードサンプルでは、オブジェクト指向には CoffeeScript ^1、関数指向には Clojure を使用しますが、文章は汎用的に書いてあります。

最下部に用語集があるので、わかりづらい単語、表現があったら参照してください。

@ympbyc
ympbyc / FunctionalJs.md
Last active November 2, 2024 00:52
Functional JavaScript

Functional JavaScript

2013 Minori Yamashita [email protected]

-- ここにあなたの名前を追記 --

目次

@esehara
esehara / 1.1.1.markdown
Last active March 3, 2019 18:37
『計算機プログラムの構造と解釈』一章一節読書メモ

普通の四則演算として考えると次のように表せる。

1 + 2 * 3 + 4 / 2

これは、下のようにまとめることが可能だ。

1 + (2 * 3) + (4 / 2)
@yat1ma30
yat1ma30 / hatepos.py
Last active March 24, 2019 08:09
はてなブログAtomPub APIを使った簡易投稿クライアントアプリ
# -*- coding: utf-8 -*-
import base64
import datetime
import hashlib
import random
import requests
import time