Skip to content

Instantly share code, notes, and snippets.

@philopon
philopon / Main.purs
Created December 19, 2014 13:31
xhr-json
module Main where
import Data.Maybe
import Debug.Trace
import Data.JSON
import Network.XHR
main = get defaultAjaxOptions
{ onReadyStateChange = onSuccess $ \response -> do
txt <- getResponseText response
@mithrandi
mithrandi / Dockerfile
Last active August 29, 2015 14:12
Dockerfile for Halcyon
FROM ubuntu:14.04
RUN apt-get update && apt-get install -y build-essential git pigz zlib1g-dev vim curl libpq-dev
ADD . /halcyon
RUN ["/halcyon/halcyon", "paths"]
ENTRYPOINT ["/halcyon/halcyon"]
@pbrisbin
pbrisbin / steps.md
Last active August 29, 2015 14:13
Testing halcyon-based local development

Go through the following from within the project root.

Project prep

This will:

  • Move ~/.ghc to avoid a known bug
  • Create a user-writable /app for building
  • Clone the halcyon build tool into /app
  • Remove any current build artifacts
@gallais
gallais / InstanceLoop.agda
Created September 1, 2015 12:29
Making instance resolution loop
module InstanceLoop where
record Target (A : Set) : Set where
constructor mkTarget
field
a : A
instance
loop : {A : Set} {{tA : Target A}} → Target A
@nzoschke
nzoschke / heroku-secrets.md
Last active December 14, 2015 08:49
Heroku Secrets - Waza 2012

Twelve-Factor

  • Adam Wiggins' The Twelve-Factor App
  • Modern software design for software-as-a-service
  • Heroku enables and enforces these patterns

Continuous Deployment

  • One codebase - many deploys
  • 2 million releases in Feb alone
@snoyberg
snoyberg / yesod.hs
Created April 8, 2013 10:11
Better Yesod benchmark
{-# LANGUAGE QuasiQuotes, TemplateHaskell, TypeFamilies, MultiParamTypeClasses, OverloadedStrings #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE EmptyDataDecls #-}
import Yesod
import System.Environment (getArgs)
import qualified Network.Wai.Handler.Warp as Warp
import Data.Text (Text)
import Data.Conduit.Pool (Pool)
import Database.Persist.Store (get, PersistValue (PersistInt64))
@mxswd
mxswd / Foo.hs
Last active December 16, 2015 02:39
Example usage (with warnings removed)
module Foo where
foreign export ccall foo :: Int -> IO Int
foo :: Int -> IO Int
foo n = return (length (f n))
f :: Int -> [Int]
f 0 = []
f n = n:(f (n-1))
infix 1000 ♯_
postulate
∞ : ∀ {a} (A : Set a) → Set a
♯_ : ∀ {a} {A : Set a} → A → ∞ A
♭ : ∀ {a} {A : Set a} → ∞ A → A
{-# BUILTIN INFINITY ∞ #-}
{-# BUILTIN SHARP ♯_ #-}
{-# BUILTIN FLAT ♭ #-}
module Scratch where
postulate
Inf : ∀ {a} (A : Set a) → Set a
delay : ∀ {a} {A : Set a} → A → Inf A
force : ∀ {a} {A : Set a} → Inf A → A
{-# BUILTIN INFINITY Inf #-}
{-# BUILTIN SHARP delay #-}
{-# BUILTIN FLAT force #-}
@osnr
osnr / ascent.dot
Created October 11, 2013 04:11
As Stu Card remembers it, “There was this thread of ideas that led from Vannevar Bush through J. C. R. Licklider, Doug Engelbart, Ted Nelson, and Alan Kay–a thread in the Ascent of Man. It was like the Holy Grail. We would rationalize our mission according to what Xerox needed, and so on. But whenever we could phrase an idea so that it fell on t…
digraph {
"Vannevar Bush" -> "Claude Shannon";
"Claude Shannon" -> "Ivan Sutherland";
subgraph ailab {
rank = same;
edge[dir=none];
"Seymour Papert" -> "Marvin Minsky";