Skip to content

Instantly share code, notes, and snippets.

View jdoiwork's full-sized avatar
🏠
Working from home

Junichiro Doi jdoiwork

🏠
Working from home
View GitHub Profile
@jdoiwork
jdoiwork / gist:8049235
Last active December 31, 2015 21:49
WPFの子要素のVisualをすべて取得する。
private static IEnumerable<DependencyObject> GetVisualChildren(DependencyObject obj)
{
var count = VisualTreeHelper.GetChildrenCount(obj);
var cs = Enumerable.Range(0, count).Select(n => VisualTreeHelper.GetChild(obj, n));
foreach (var c in cs)
{
foreach (var cc in GetVisualChildren(c))
{
yield return cc;

Yesodのscaffold直後のホームはなんて書いてある?

タイトル

Hello

ちょイース

1.

Now that you have a working project you should use the Yesod book to learn more. You can also use this scaffolded site to explore some basic concepts.

ビルド

cabal clean
cabal install --only-dependencies
cabal configure
cabal build

実行

{-# LANGUAGE RecordWildCards #-}
module Handler.Hoge where
import Import
-- ...
data Person = Person
{ name :: Text
def λ (&block)
(lambda &block).curry
end
plus = λ {|x, y| x + y }
plus1 = plus[1]
three = plus1[2]
puts three
class Aaa
def hello
'a'
end
end
class Bbb
def hello
'b'
end
class Nothing
constructor: () ->
bind: (f) ->
@
class Just
constructor: (b) ->
@just = b
bind: (f) ->
docker run -d -p 9200:9200 -p 9300:9300 --name jdoi-elasticsearch elasticsearch -Des.network.host=::0
@jdoiwork
jdoiwork / Blaze-ByteString-Builder-Example.hs
Created March 31, 2016 06:22
Blaze.ByteString.Builder and Writer Monad
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Blaze.ByteString.Builder (toLazyByteString, Builder)
import Blaze.ByteString.Builder.ByteString (fromByteString)
import Data.String (IsString)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Writer (execWriterT, execWriter, WriterT, Writer, MonadWriter, tell)
@jdoiwork
jdoiwork / myMiddleware.hs
Created April 1, 2016 02:35
Network.Wai Middleware example
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Network.Wai
import Network.HTTP.Types
import Network.Wai.Handler.Warp (run)
import qualified Data.ByteString.Lazy as LBS(fromStrict)
import qualified Data.ByteString as SBS(ByteString)