Skip to content

Instantly share code, notes, and snippets.

View hlian's full-sized avatar
🦫
beaver

Hao Lian hlian

🦫
beaver
View GitHub Profile
@hlian
hlian / Orphan.hs
Last active December 29, 2015 22:54
FromJSON orphans for Sound.OSC types in the hosc-json package
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-orphans #-}
module Sound.OSC.Type.JSON.Orphan.Black where
import BasePrelude
import Data.Aeson
import Data.Aeson.Types
import Sound.OSC.Type
@hlian
hlian / SingleNight.hs
Created December 9, 2015 07:33
Ninth day of Advent of Code 2015
{-# LANGUAGE TupleSections #-}
module Main where
import BasePrelude hiding (insert)
import Data.Map (Map)
import Data.Set (Set, member, insert)
import qualified Data.Map as Map
import qualified Data.Set as Set
type Graph = Map String [(Int, String)]
graphIO = (lines >>> connect) <$> readFile "<snip>"
{
packageOverrides = pkgs:
let
haskellPackages = pkgs.haskell-ng.packages;
dontCheck = pkgs.haskell-ng.lib.dontCheck;
mapper = (p: dontCheck p);
in {
haskellEnv = haskellPackages.ghcHEAD.ghcWithPackages (p:
(map mapper [ p.lens ]) ++ [ p.cabal2nix ]
);
{ "a": 3, "b": 4, "o": { "oa": 1} }
{-# LANGUAGE NoImplicitPrelude, OverloadedStrings #-}
import BasePrelude
import Data.List.Split (splitOn)
import qualified Data.Map as M
import Hakyll hiding (defaultContext)
import qualified Hakyll as H
import System.FilePath (replaceExtension, takeFileName)
import qualified Text.Pandoc as P
you're on linux so you know what you're doing
import Data.Aeson
import Data.Lens
import Data.Text.Lazy (Text)
import Network.Wai (Application, run)
import Network.Wreq (HTTResponse)
newtype User = User Text
newtype Channel = Channel Text
newtype Icon = Icon Text
newtype Token = Token Text

Keybase proof

I hereby claim:

  • I am hlian on github.
  • I am hao (https://keybase.io/hao) on keybase.
  • I have a public key whose fingerprint is 93FE 857A 4518 BCC0 4CC0 33D4 6A05 DA49 067B 7501

To claim this, I am signing this object:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>SQLite Download Page</title>
<style type="text/css">
body {
margin: auto;
font-family: Verdana, sans-serif;
padding: 8px 1%;
@hlian
hlian / gist:5708956
Created June 4, 2013 19:49
.hgrc for interns
[ui]
username = Your Name <yourname@fogcreek.com>
editor = "c:/path/to/your/favorit/editor.exe"
[extensions]
mq =
graphlog =
record =
bookmarks =
rebase =