Skip to content

Instantly share code, notes, and snippets.

View yogsototh's full-sized avatar

Yann Esposito yogsototh

View GitHub Profile
@yogsototh
yogsototh / app.elm
Created May 28, 2015 13:53
Error: the notify function has been called synchronously!
import Signal exposing (Address,Mailbox,mailbox)
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onClick,on,targetValue)
import Task exposing (Task,andThen)
import Http exposing (multipart,stringData)
import Time exposing (every,second)
main : Signal Html
@yogsototh
yogsototh / bug.elm
Created May 28, 2015 09:22
elm Task or port bug?
import Http
import Markdown
import Html exposing (Html)
import Task exposing (Task, andThen)
import Time exposing (every, second)
main : Signal Html
main = Signal.map Markdown.toHtml readme.signal
import Timer
import Signal exposing (Address,Mailbox,mailbox)
import Html exposing (div, button, text, Html)
import Html.Events exposing (onClick)
import Task exposing (Task,andThen)
import Http
import Time exposing (every,second)
#toc,.toc { position: fixed;font-size: .8em;top: 8em; left: 80em; background: #fafafa;max-height: 80%; overflow: auto; display: block; }
html { font-family: Sevarek, Helvetica, sans-serif; font-size: 1.1em; }
div#content { width: 35em; color: #657b83; background: #fafafa; font-size: 1.2em; }
a {color: #268bd2 !important; }
a:visited {color: #6c71c4 !important; }
a:hover {color: #cb4b16 !important; }
table.wikitable { background-color: #fafafa; color: #657b83; }
table.wikitable > * > tr > th { background-color: #eee; }
body, div#mw-head, #catlinks {background-color: #eee;}
code,pre{background-color: #eee;color:#657b83;}
Serve javascript
> newtype RepJavascript = RepJavascript Content
> instance ToTypedContent RepJavascript where
> toTypedContent (RepJavascript c) = TypedContent typeJavascript c
> instance HasContentType RepJavascript where
> getContentType _ = typeJavascript
> deriving instance ToContent RepJavascript
> deriving instance ToContent Javascript where
> toContent = toContent . renderJavascript
site.hs:230:50:
Couldn't match expected type `M.Map k0 [a0]'
with actual type `Metadata'
In the second argument of `M.lookup', namely `metadata'
In the second argument of `($)', namely `M.lookup "tags" metadata'
In the second argument of `($)', namely
`maybe "" renderMeta $ M.lookup "tags" metadata'
@yogsototh
yogsototh / ERROR
Last active December 14, 2015 15:19
Weird Error
site.hs:221:71:
Couldn't match expected type `M.Map String String'
with actual type `Metadata'
In the second argument of `ylookup', namely `metadata'
In the second argument of `($)', namely `ylookup "image" metadata'
In the second argument of `($)', namely
`maybe "/Scratch/img/presentation.png" id
$ ylookup "image" metadata'
site.hs:230:50:
@yogsototh
yogsototh / gist:5089746
Created March 5, 2013 11:43
Dependency problem
main = hakyll $ do
rulesExtraDependencies [IdentifierDependency "Scratch/css/include/modern.sass"] $ do
match "Scratch/css/*" $ do
route $ setExtension "css"
compile $ getResourceString >>=
withItemBody (unixFilter "sass" ["--trace"]) >>=
return ∘ fmap compressCss
@yogsototh
yogsototh / gist:3032273
Created July 2, 2012 09:27
cabal hell
cabal-dev install
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: inmanis-0.0.0 (user goal)
trying: http-conduit-1.4.1.10 (dependency of inmanis-0.0.0)
trying: base64-bytestring-0.1.2.0 (dependency of http-conduit-1.4.1.10)
trying: attoparsec-0.10.2.0 (dependency of http-conduit-1.4.1.10)
trying: yesod-test-0.2.1 (dependency of inmanis-0.0.0)
trying: HUnit-1.2.4.2/installed-6a8... (dependency of yesod-test-0.2.1)
next goal: yesod-platform (dependency of inmanis-0.0.0)
@yogsototh
yogsototh / defaultComplex.lhs
Created June 17, 2012 16:46
Complex efficiency difference
## First version
We can consider two parts.
The first being mostly some boilerplate[^011].
And the second part more focused on OpenGL and content.
[^011]: Generally in Haskell you need to declare a lot of import lines.
This is something I find annoying.
In particular, it should be possible to create a special file, Import.hs
which make all the necessary import for you, as you generally need them all.