Skip to content

Instantly share code, notes, and snippets.

View eagletmt's full-sized avatar

Kohei Suzuki eagletmt

View GitHub Profile
# TypableMap: 公式RT
Misuzilla::IronRuby::TypableMap.register("rt", "ReTweet Command") do |p, msg, status, args|
System::Diagnostics::Trace.WriteLine("RT: #{status.to_string}")
Session.RunCheck(Misuzilla::Applications::TwitterIrcGateway::Procedure.new{
Session.twitter_service.POST("/statuses/retweet/#{status.id}.xml", System::Array[System::Byte].new(0))
Session.send_channel_message("RT: #{status.text}")
}, System::Action[System::Exception].new{|ex|
Session.send_channel_message(msg.receiver, Server.server_nick, "メッセージ送信に失敗しました", false, false, true)
})
true # true を返すとハンドルしたことになりステータス更新処理は行われない
module Bar where
myReverse [] = []
myReverse (x:xs) = myReverse xs ++ [x]
class Nil {}
class Cons(X, XS) {}
template length(T) {
static if (is(T == Nil)) {
const length = 0;
} else static if (is(T _ == Cons!(X, XS), X, XS)) {
const length = 1 + length!(XS);
}
}
{-# LANGUAGE ScopedTypeVariables #-}
{--
Copyright (c) 2009, eagletmt
Released under the MIT License <http://opensource.org/licenses/mit-license.php>
--}
-- | This program checks if newly followed or removed.
-- Please install the following libraries on ahead:
-- json <http://hackage.haskell.org/package/json>
-- base64-string <http://hackage.haskell.org/package/base64-string>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <mach-o/loader.h>
#include <mach-o/nlist.h>
#include <assert.h>
void *find_function(char *obj, const char *name);
int main(void)
{-# LANGUAGE ScopedTypeVariables #-}
module Main where
import Network.HTTP
import Text.JSON
import System.IO.UTF8 as U
data Feed = Feed (JSObject JSValue)
stringFromObj :: String -> JSObject JSValue -> String
stringFromObj s obj = let Ok (v::JSString) = valFromObj s obj in fromJSString v