Skip to content

Instantly share code, notes, and snippets.

@Tarmean
Tarmean / mapOp.vim
Last active September 13, 2015 20:42
if exists('g:mapCommandOpLoaded') || (v:version < 700)
finish
endif
let g:mapCommandOpLoaded = 1
function! mapOp#createOp(command)
norm! gv
execute "norm! " . a:command
call mapOp#popVis()
endfunction
1573 { }{-|}
1573 KPA
--------------
1330 None
50 -L
18 #
16 0
{ rule = { name = "Plover: Suggestions Display" },
properties = {floating=true,
maximized_vertical=true, maximized_horizontal=false },
callback = function (c)
local cl_width = 250 -- width of buddy list window
local scr_area = screen[c.screen].workarea
local cl_strut = c:struts()
-- scr_area is affected by this client's struts, so we have to adjust for that
@Tarmean
Tarmean / .hs
Last active February 2, 2017 23:26
data Number = forall a . Number (TypeEnum a) a
higherPred :: forall dict . (forall a . TypeEnum a -> dict) -> Number -> Number -> dict
higherPred f (Number e1 _) (Number e2 _) = if ordering e1 >= ordering e2 then f e1 else f e2
data NumDict = forall a . Num a => NumDict (TypeEnum a)
matchNum :: forall a . TypeEnum a -> NumDict
matchNum Integer = NumDict Integer
matchNum Rational = NumDict Rational
matchNum Real = NumDict Real
matchNum Complex = NumDict Complex
@Tarmean
Tarmean / .hs
Last active May 13, 2017 16:51
{-# Language RebindableSyntax #-}
{-# Language FlexibleInstances #-}
{-# Language NoMonomorphismRestriction #-}
{-# Language TemplateHaskell #-}
import qualified Prelude as P
import Control.Monad.IO.Class
import Prelude hiding ((>>=), return)
import Control.Lens hiding (imap)
@Tarmean
Tarmean / LMonadMonomorphic.hs
Created August 22, 2017 15:44
Comparison of multiplicity polymorphic vs linear monad
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE RebindableSyntax #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeFamilyDependencies #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE UnboxedTuples #-}
@Tarmean
Tarmean / .hs
Last active November 10, 2017 13:44
import Data.Functor (void)
import qualified Data.Text as T
import Text.Megaparsec
import Text.Megaparsec.Text as T
data Expr = App Expr Expr | Var T.Text | Lambda T.Text Expr | S | K | I deriving Show
translate :: Expr -> Expr
translate (App a b) = App (translate a) (translate b)
@Tarmean
Tarmean / tree-style-tabs.css
Last active January 5, 2018 20:52
Firefox tree-style-tabs config
@media (max-width: 120px) {
#tabbar {
margin-top: 5px !important;
overflow-x: hidden;
}
:root {
background: var(--tab-surface) !important;
}
/* the changes between.tab and .tab.faviconized differ between themes. doing this twice seems the most consistent */
.tab {
read-input = READ_BYTE
print-byte = PRINT_BYTE
Z = λf.(λx.(x x) λx.(f λy.((x x) y)))
fix = Z
make-pair = λa.λb.λf.(f a b)
fst = λp.(p (λx.λy.x))
snd = λp.(p (λx.λy.y))
{-# Language OverloadedStrings #-}
import qualified Data.Set as S
import qualified Data.Map as M
import Data.List (sort, foldl', find)
import Data.Function(on)
import Control.Applicative (liftA2)
import Data.Monoid ((<>))
import Control.Arrow ((&&&))