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
class Renderable a where | |
render :: a -> IO () | |
newtype Rectangle = Rectangle { width :: Double, height :: Double } | |
instance Renderable Rectangle where | |
render = undefined | |
newtype Circle = Circle { radius :: Double } |
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
data Thing = Thing | |
{ _foo :: Int | |
, _bar :: String } | |
buildFoo :: Other -> Thing | |
buildfoo = Thing <$> buildFoo | |
<*> buildBar | |
where buildFoo :: Other -> Int | |
buildFoo = undefined | |
buildBar :: Other -> String |
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
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE TemplateHaskell #-} | |
-- | | |
module Data.Torrent where | |
import Control.Applicative | |
import Control.Lens | |
import Data.AttoBencode |
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
[1,2,3] [] [] | |
[2,3] [1] [] | |
[3] [1] [2] | |
[3] [] [1,2] | |
[] [3] [1,2] | |
[1] [3] [2] | |
[1] [2,3] [] | |
[] [1,2,3] [] |
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
span.messageRow { | |
} | |
span.messageRow span.date { | |
} | |
span.messageRow span.message { | |
} | |
span.message span.authorWrap { |
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
foo = bar | |
. bizz | |
. bazz | |
foo = bar | |
<> bizz | |
<> bazz | |
expr = term |
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
// Convert to jQuery please... | |
var field = $('password_confirmation_field'); | |
field.hide(); | |
$('user_password').observe('focus', field.show.bind(field)); | |
// This the best? | |
var confirmation = $('#password_confirmation_field').hide(); | |
$('#user_password').focus(function () { | |
confirmation.show(); | |
}); |
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
_______________ | |
< PLAY [gitlab] > | |
--------------- | |
\ ^__^ | |
\ (oo)\_______ | |
(__)\ )\/\ | |
||----w | | |
|| || | |
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
{-# LANGUAGE OverloadedStrings #-} | |
module CommandParser where | |
import Data.Attoparsec.ByteString.Char8 | |
import Data.Attoparsec.Combinator | |
import Control.Applicative | |
import Data.ByteString | |
data Command = Retrieve | Delete | New deriving Show |
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
// Examples: | |
// | |
// HTML: | |
// <form action='messages/1/mark_unread'><input type='submit' class='button_to_link' value='Mark Unread'/></form> | |
// | |
// Rails: | |
// button_to "Mark as unread", mark_as_unread_message_path(message), :method => :put, :class => "button_to_link" | |
// | |
// jQuery: | |
// $(document).ready(function() { |
OlderNewer