Skip to content

Instantly share code, notes, and snippets.

View yogsototh's full-sized avatar

Yann Esposito yogsototh

View GitHub Profile
@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.

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.
@yogsototh
yogsototh / brew --config
Created April 5, 2012 21:31
brew devil fail
~ brew --config
HOMEBREW_VERSION: 0.9
HEAD: 4f16573afa069d13c1fe5d4a7ebcf52cc403bed4
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit sandybridge
OS X: 10.7.3
Kernel Architecture: x86_64
Xcode: 4.3.2
GCC-4.0: N/A