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
module Test.Util.ArbitraryInstances where | |
import Data.List (intercalate) | |
import Control.Applicative ((<$>), (<*>), pure) | |
import Network.URI (URI(..), URIAuth(..), uriToString) | |
import Test.QuickCheck | |
newtype URIPair | |
= URIPair { fromPair :: (String, String) } | |
deriving (Show) |
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
class git { | |
include git::install | |
... | |
} |
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 GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE DeriveDataTypeable #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Data.Aeson (FromJSON(..), Value(..), Result(..)) | |
import Data.Aeson.Types (parse) | |
import Data.Time.Clock (UTCTime) | |
import Data.Time.Format (FormatTime, parseTime) | |
import Data.Typeable (Typeable) |
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 FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
module Main where | |
import Control.Failure (Failure(..)) | |
import Control.Monad.Trans (MonadIO, liftIO, lift) | |
import Control.Monad.IO.Control (MonadControlIO) |
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 Control.Applicative | |
import HSH ((-|-)) | |
import qualified HSH as Shell | |
import qualified Data.Attoparsec.Char8 as Parser | |
import Data.ByteString.Char8 (ByteString) | |
import qualified Data.ByteString.Char8 as BS |
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
numbers :: [Int] | |
numbers = zip [1, 2, 3] [4, 5, 6] | |
main :: IO () | |
main = print numbers | |
-- Output: [(1,4), (2,5), (3,6)] |
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
if !hasmapto('<Plug>GoldenRatioResize') && | |
\ !hasmapto('<LEADER>g', 'n') | |
echom "Doing mapping to <LEADER>g" | |
nnoremap <LEADER>g <Plug>GoldenRatioResize | |
endif | |
nnoremap <unique> <Plug>GoldenRatioResize :call <SID>ResizeToGoldenRatio()<CR> |
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
j <- select "p" $ do | |
addHTMLClass "ohmy" -- internally using s2js | |
show $ do -- internal monad (different one) | |
speed Slow | |
easing 1024 | |
appendCallback $ do | |
-- some callback | |
appendCallback otherIOAction | |
-- other attributes are Nothing by default |
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
module Main where | |
import Data.Map (Map) | |
import qualified Data.Map as Map | |
import Data.List (foldl') | |
import Data.Maybe (fromMaybe, fromJust) | |
import Control.Monad (liftM, forM_) | |
allBase :: String -> Int | |
allBase xs = foldr fn 0 $ zip [0..] (xs' ++ [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
# Set prefix to C-a to keeps things simpler | |
unbind C-b | |
unbind l | |
set -g prefix C-a | |
bind C-a send-prefix | |
set -g default-terminal "screen-256color" | |
# Use vi keybindings in the copy and scroll mode | |
set-window-option -g mode-keys vi | |
# Use vi keybindings on the prompt |