Skip to content

Instantly share code, notes, and snippets.


Max A.K. max630

View GitHub Profile
max630 / Makefile
Last active Aug 29, 2015
dynamic c++ calls
View Makefile
all: dynamic dynamic.h
g++ -g -Wall -Werror -std=c++11 -shared -o
dynamic: dynamic.h
g++ -g -Wall -Werror -std=c++11 -o dynamic -ldl
View gist:07241cbd17065b946158
max630 / OMSet.hs
Last active Aug 29, 2015
simulation of ocaml's modules with typeclasses with type families
View OMSet.hs
{-# LANGUAGE TypeFamilies, ScopedTypeVariables, ExistentialQuantification, GADTs, Rank2Types #-}
{-# LANGUAGE FlexibleContexts #-}
module OMSet where
import System.Environment (getArgs)
import qualified Data.Set as DS
-- ocaml modules always used exlpicitly, without inferring from arguments
-- simulate it by adding bogus argument to all typeclass types and methods
View diffcc_new.txt
This file has been truncated, but you can view the full file.
diff --cc Documentation/DocBook/.gitignore
index c102c02,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..c102c02
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/DocBook/.gitignore
+++ b/Documentation/DocBook/.gitignore
diff --cc Documentation/block/barrier.txt
index 0397151,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000,0000000..0397151
mode 100644,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000,000000..100644
--- a/Documentation/block/barrier.txt
View dumb-tv.html
<!DOCTYPE html>
reads file films.json from the same directory. The file should contain array of arrays,
each of them of length 2. First element is identifier, second - path to the video file. Like this:
["a7bb5682ff4bf88a5140165a638770f6b38f2173", "terminator1.mp4"],
["419278cd408cbda642b433e14f18b38977f2a048", "terminator2.mp4"],
["df6ec9c82ca899c3c013daacf283d1c086499b2d", "alien-vs-predator.mp4"]
View gist:d192ad3bb652c6e6962e
Prelude> data Foo = Foo
Prelude> data Bar = Bar
Prelude> data Baz = Baz
Prelude> data DoesntHave
Prelude> data Has
Prelude> data MyXml:: * -> * -> * -> * where { DFoo :: Foo -> MyXml Has a b; DBar :: Bar -> MyXml a Has b; DBaz :: Baz -> MyXml a b Has }
Prelude> :t [DFoo Foo, DBaz Baz]
[DFoo Foo, DBaz Baz] :: [MyXml Has a Has]
Prelude> let a = DBar Bar :: MyXml Has DoesntHave Has
max630 / .Xdefaults
Created May 30, 2015
urxvt keyboard selection
View .Xdefaults
URxvt.perl-lib: /home/max/configs/rxvt
URxvt.perl-ext-common: default,keyboard-selection,selection-popup
URxvt.keysym.C-Tab: perl:keyboard-select:activate
URxvt.keysym.M-v: perl:keyboard-select:activate
URxvt.utmpInhibit: false
max630 / LibTest.hs
Created Nov 28, 2011
stage restriction for instances in quotations
View LibTest.hs
{-# LANGUAGE TemplateHaskell #-}
module LibTest where
import Language.Haskell.TH.Ppr (pprint)
import Language.Haskell.TH.Syntax (runQ, Lit(StringL), reify)
import Language.Haskell.TH.Lib (litE)
import Monad (liftM)
import Data.Typeable (typeOf)
import Language.Haskell.TH.Syntax (Q, Exp)
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.