Skip to content

Instantly share code, notes, and snippets.

@max630
max630 / Makefile
Last active August 29, 2015 14:01
dynamic c++ calls
all: dynamic_lib.so dynamic
dynamic_lib.so: dynamic_lib.cc dynamic.h
g++ -g -Wall -Werror -std=c++11 -shared -o dynamic_lib.so dynamic_lib.cc
dynamic: dynamic_client.cc dynamic.h
g++ -g -Wall -Werror -std=c++11 -o dynamic dynamic_client.cc -ldl
@max630
max630 / gist:07241cbd17065b946158
Created August 5, 2014 17:21
pa calls used by skype
pa_stream_new
pa_stream_set_state_callback
pa_stream_set_write_callback
pa_stream_set_read_callback
pa_stream_set_underflow_callback
pa_stream_connect_playback
pa_stream_connect_record
pa_stream_disconnect
pa_stream_unref
pa_stream_get_state
@max630
max630 / OMSet.hs
Last active August 29, 2015 14:07
simulation of ocaml's modules with typeclasses with type families
{-# 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
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
@max630
max630 / dumb-tv.html
Last active August 29, 2015 14:19
Dumb Tv
<!DOCTYPE html>
<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"]
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
max630 / .Xdefaults
Created May 30, 2015 09:40
urxvt keyboard selection
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
max630 / test.py
Created October 12, 2011 06:21
test
print 5
@max630
max630 / LibTest.hs
Created November 28, 2011 23:44
stage restriction for instances in quotations
{-# 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
max630 / H.hs
Created December 21, 2011 07:19
Уточнение типа по мере продвижения по файлу
{-# LANGUAGE TemplateHaskell #-}
module H where
import Language.Haskell.TH
f = [42]
$(do
i <- reify (mkName "f")
runIO (print i)