Skip to content

Instantly share code, notes, and snippets.

@masaedw
masaedw / gist:966395
Created May 11, 2011 12:50
更新後のgem
abstract (1.0.0)
actionmailer (3.0.7)
actionpack (3.0.7)
activemodel (3.0.7)
activerecord (3.0.7)
activeresource (3.0.7)
activesupport (3.0.7)
arel (2.1.0, 2.0.9)
builder (3.0.0, 2.1.2)
bundler (1.0.13)
def bellman_filter msg
if /べるまん/ =~ msg.toeuc
"なぜ人はべるまんに通うのか"
end
end
require 'rubygems'
require 'oauth'
require 'json'
CONSUMER_KEY = 'XXXXXXXXXXXXX'
CONSUMER_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXX'
ACCESS_TOKEN = 'XXXXX-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
ACCESS_TOKEN_SECRET = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
# 下準備
module Main where
import Text.Pandoc
import Prelude hiding (getContents, putStrLn)
import System.IO.UTF8
markdownToHtml :: String -> String
markdownToHtml =
(writeHtmlString defaultWriterOptions {writerReferenceLinks = True}) .
readMarkdown defaultParserState
{-# LANGUAGE QuasiQuotes, TypeFamilies, GeneralizedNewtypeDeriving, TemplateHaskell, OverloadedStrings, GADTs #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
module Yiki where
import Control.Applicative ((<$>), (<*>))
import Control.Monad.IO.Class
import Data.Text
import Data.Time
import Database.Persist
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative
import Data.Attoparsec
import qualified Data.Attoparsec as A
import qualified Data.ByteString as B
data MDElement = Elem B.ByteString
| Link B.ByteString
deriving (Show, Eq)
@masaedw
masaedw / a.pl
Created October 4, 2011 09:07 — forked from yoppi/a.pl
my $t;
while (<>) {
my ($key, $value) = split;
push @{$t->{$key}}, $value;
}
foreach $key (keys %{$t}) {
my $s = join ", ", @{$t->{$key}};
print "$key $s\n";
#if INTERACTIVE
#r "office.dll"
#r "Microsoft.Office.Interop.Excel.dll"
#endif
open System
open System.IO
open System.Runtime.InteropServices
open Microsoft.Office.Interop.Excel
@masaedw
masaedw / ng.fs
Created October 8, 2011 01:38
FSC: エラー FS0192: 内部エラー: dest_fun_typ: not a function type でコンパイラが落ちる
let main() =
let (@@) = id
[1;2;3;4;5]
|> Seq.map @@ fun x -> x * x
|> ignore
["a";"b";"c";"d"]
|> Seq.map @@ fun x -> x + x
|> Seq.iter @@ printf "%s"
@masaedw
masaedw / fizzbuzz.hs
Created October 9, 2011 09:47 — forked from yuya-takeyama/fizzbuzz.hs
FizzBuzz in Haskell.
fizzbuzzList = [x | x <- map fizzbuzz [1..]]
where fizzbuzz x | x `mod` 15 == 0 = "FizzBuzz"
| x `mod` 5 == 0 = "Buzz"
| x `mod` 3 == 0 = "Fizz"
| otherwise = show x
main = do
mapM_ putStrLn $ take 100 $ fizzbuzzList