This file contains 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
todo :: Widget () | |
todo = do | |
section ! id "todoapp" $ do | |
nelem "header" ! id "header" | |
section ! id "main" $ do | |
ul ! id "todo-list" $ noHtml | |
footer ! id "footer" $ do | |
span ! id "todo-count" $ noHtml | |
ul ! id "filters" $ noHtml |
This file contains 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
$ mkdir haste | |
$ cd haste | |
$ cabal sandbox init | |
$ cabal update | |
$ cabal install cabal-install | |
$ export PATH=$PATH:.cabal-sandbox/bin | |
$ cabal install haste-compiler | |
$ haste-boot |
This file contains 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
$ bundle exec rails s | |
/Users/ogata/.rvm/gems/ruby-2.1.5/gems/activesupport-3.2.21/lib/active_support/dependencies.rb:251:in `require': This installation of RMagick was configured with ImageMagick 6.9.0 but ImageMagick 6.9.1-1 is in use. (RuntimeError) |
This file contains 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
-- Aeson は ByteString から生成するのでこのプラグマを使用する | |
{-# LANGUAGE OverloadedStrings #-} | |
-- Data.Aeson.TH を利用するとはかどるのでこのプラグマを使用する | |
{-# LANGUAGE TemplateHaskell #-} | |
import Data.Aeson (decode, encode) | |
import Data.Aeson.TH (deriveJSON, defaultOptions, Options(..)) | |
import Data.Char (toLower) | |
data Foo a = Foo { fooId :: a } deriving (Show, Read, Eq) |
This file contains 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
$ mkdir -p ~/Library/Application\ Support/Avian/Bundles | |
$ cd ~/Library/Application\ Support/Avian/Bundles | |
$ git clone https://github.com/mads379/Whitespace.tmbundle.git |
This file contains 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 qualified GHC.IO.Handle as GIH | |
import qualified System.Directory as SD | |
import qualified System.IO.Temp as SIT | |
main :: IO () | |
main = do | |
(path, handle) <- SIT.openTempFile "/tmp" "hoge.txt" | |
putStrLn $ "path: '" ++ path ++ "'" | |
putStrLn $ "handle: '" ++ show handle ++ "'" | |
GIH.hShow handle >>= \x -> putStrLn $ "hShow: '" ++ x ++ "'" |
This file contains 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 qualified System.Directory as SD | |
import qualified System.IO.Temp as SIT | |
tempFile :: String -> String | |
tempFile path = path ++ "/" ++ "hoge.txt" | |
withSystemTempDir :: FilePath -> IO String | |
withSystemTempDir path = do | |
putStrLn $ "path: '" ++ path ++ "'" | |
isDirExist <- SD.doesDirectoryExist path |
This file contains 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 | |
import Test.Hspec | |
-- | セッションが保持されるファイル名。 | |
path :: String | |
path = "Session.txt" | |
-- | テストで使用するテンポラリファイル名。 | |
tmp :: String | |
tmp = "Session.tmp" |
This file contains 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 Test.Hspec | |
hello :: String -> String | |
hello name = "hello, " ++ name | |
specHello :: Spec | |
specHello = do | |
describe "hello" $ do | |
it "standard" $ | |
hello "world" `shouldBe` "hello, world" |
This file contains 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
$ defaults write com.apple.spotlight CalculationEnabled -boolean false | |
$ killall Spotlight | |
$ sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist |