Skip to content

Instantly share code, notes, and snippets.


Max A.K. max630

View GitHub Profile
max630 / Foo.hs
Last active Jan 10, 2016
attempt to use DataKinds
View Foo.hs
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FunctionalDependencies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ExplicitNamespaces #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE UndecidableInstances #-}
View wm-notes.txt
A kind of specs for window manager I need now. A bit overspecified in some places, but is a good start.
Windows are floating, should snap each other. Would be interesting to play with tiling features, but only sometimes (auto resize snapped window).
service area is along side, which is ignored by window layouting (initial placement, maximize).
Either click to focus or sloppy focus (depends on having TrackPoint). No autoraise
View gist:7348875
@-moz-document domain("") {
html, input {
font-size: 100% !important;
#topwrapper {
width: auto !important;
#content {
View 0001-gitk-refactor-split-getblobdiffline-into-IO-and-text.patch
From cd696bc74d369ac5c3a61a93afd327cddd57adf3 Mon Sep 17 00:00:00 2001
From: Max Kirillov <>
Date: Sat, 20 Apr 2013 18:26:31 +0300
Subject: [PATCH 1/3] gitk refactor: split getblobdiffline into IO and text
I would like to hack into diffs which gitk gets from commands.
To ease it, let's divide the read handler, getblobdiffline,
into reading and subsequent handling.
max630 / IOFrontend.hs
Created May 26, 2012
Enumerator-based IO Frontend for JSON-RPC
View IOFrontend.hs
module IOFrontend where
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Aeson as A
import qualified Data.Attoparsec as AP
import qualified Data.ByteString.Lazy as BSL
import qualified Data.Enumerator as E
import qualified Data.Enumerator.Binary as EB
import qualified Data.Enumerator.List as EL
import qualified GHC.IO.Handle as GIO
max630 / a.hs
Created Feb 28, 2012
parser for a toy programming language
View a.hs
parseExprControl =
do {
label <- try (do { l <- p_name; p_eq [Spec ":"]; return l})
; e <- parseExprControl
; return (Label label e)
<|> do {
try (p_eq [Spec "def"])
; name <- p_name
; p_eq [Spec "="]
View AccessorTemplateExpr.hs
{-# LANGUAGE TemplateHaskell, ViewPatterns #-}
module AccessorTemplateExpr where
import Language.Haskell.TH (reify, runIO, Info(TyConI), Dec(DataD), ppr, Con(NormalC, RecC), newName,
tupE, appE, lamE, varE, conE,
conP, varP, wildP)
import Data.Accessor.Basic (fromSetGet)
makeAccessors typeName = do
info <- reify typeName
max630 / main.rb
Created Feb 1, 2012
ruby "instance" WTF
View main.rb
def showA0()
puts self.class
puts @a
class B
def showA(t)
@a = t
max630 / H.hs
Created Dec 21, 2011
Уточнение типа по мере продвижения по файлу
View H.hs
{-# LANGUAGE TemplateHaskell #-}
module H where
import Language.Haskell.TH
f = [42]
i <- reify (mkName "f")
runIO (print i)
You can’t perform that action at this time.