This file contains hidden or 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
((g, o, m) => m(g(), o, next = (acc) => m(acc + g(), o, next)))(() => ['ズン', 'ドコ'][Math.round(Math.random())], console.log, (acc, o, next) => /ズンズンズンズンドコ$/.test(acc) ? o(acc + 'きよし') : next(acc)) | |
// g: generator | |
// o: output | |
// m: main function |
This file contains hidden or 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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleContexts #-} |
This file contains hidden or 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
import System.Random (randomRIO) | |
zndk :: [String] | |
zndk = ["ズン", "ドコ"] | |
kiyoshi :: IO () | |
kiyoshi = go 0 | |
where | |
go c = rand zndk >>= \v -> putStr v >> go' c v | |
go' c "ズン" = go (c + 1) |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
import qualified Database.MySQL.Base as MySQL | |
import Database.MySQL.Base (defaultConnectInfo, ConnectInfo(..), Option(..)) | |
test :: IO () | |
test = do | |
let conf = defaultConnectInfo { | |
connectHost = "172.17.0.2" | |
, connectDatabase = "testapp" |
This file contains hidden or 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
wget http://www.stackage.org/lts/cabal.config | |
cabal update | |
cabal sandbox init | |
cabal install alex happy yesod-bin | |
export PATH=./.cabal-sandbox/bin:$PATH | |
yesod init --bare | |
cabal install -j --enable-tests --max-backjumps=-1 --reorder-goals | |
yesod devel |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
require "rubygems" | |
require "amqp" | |
require "msgpack" | |
EventMachine.run do | |
AMQP.connect do |conn| | |
channel = AMQP::Channel.new(conn) |
This file contains hidden or 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
using System; | |
using System.Data; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
namespace KrdLab.Skype | |
{ | |
// 画面ロックを検知して,Skype の UserStatus を Away/Online と切り換えるだけ. | |
public partial class SkypeControlForm : Form | |
{ |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Database.Cassandra.Basic | |
import System.Environment (getArgs) | |
import Control.Monad.IO.Class (liftIO) | |
import Control.Monad.Instances () | |
import Data.Binary (encode, decode) | |
import qualified Data.ByteString.Lazy.Char8 as BS (putStrLn) |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import System.Environment (getArgs) | |
import Control.Exception (bracket) | |
import Network.AMQP | |
import qualified System.IO.UTF8 as IoU8 (getLine, putStrLn) | |
import qualified Data.ByteString.Lazy.UTF8 as U8 | |
main :: IO () |
This file contains hidden or 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
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Database.Redis | |
import Control.Monad.IO.Class (liftIO) | |
main :: IO () | |
main = do | |
conn <- connect defaultConnectInfo { connectHost = "xxx.xxx.xxx.xxx" } | |
runRedis conn $ do |