Skip to content

Instantly share code, notes, and snippets.

View yogsototh's full-sized avatar

Yann Esposito yogsototh

View GitHub Profile
@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 / 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:
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'
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
#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;}
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)
@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
@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 / README.md
Created February 10, 2016 12:50
Add Java Certificate

Add Java Cacert

Use the preceeding script when you get

SSLHandshakeException javax.net.ssl.SSLHandshakeException: General SSLEngine problem

You generally need to add the certificate for the website you want to add.

@yogsototh
yogsototh / metrics.json
Last active June 16, 2016 15:34
JSON from metrics-clojure
{
"ring.handling-time.CONNECT": {
"max": 0,
"mean": 0.0,
"min": 0,
"percentiles": {
"0.75": 0.0,
"0.95": 0.0,
"0.99": 0.0,
"0.999": 0.0,