Skip to content

Instantly share code, notes, and snippets.

@kowey
kowey / gist:2420144
Created April 19, 2012 10:29 — forked from cartazio/gist:1655271
Haskell GTK on 64 bit MacOS X

Notes

  • on lion (and snow leopard i suppose), make sure you are using a 64 bit install of ghc. Also, unless you are suggesting an edit to these directions, please go ask people on the relevant mailing list or wiki for help :)
  • Tested on ghc 7.2.2, assumes you have standard developer things installed on mac, like x11 and stuff
  • Also tested on GHC 7.0.4 (Haskell Platform) with XCode 4.3.
  • These notes were originally brought to you by Carter Schonwald; the “I” probably refers to him. Eric Kow will refer to himself in the third person).

GHC 7.4.x

  • gtk2hs 0.12.2 won't build with ghc 7.4.1, but the current darcs repo for gtk2hs does build
src/Data/Semigroup/Instances.hs:11:10: error:
Duplicate instance declarations:
instance Measured v a => Semigroup (FingerTree v a)
-- Defined at src/Data/Semigroup/Instances.hs:11:10
instance [safe] Measured v a => Semigroup (FingerTree v a)
-- Defined in ‘Data.FingerTree’
|
11 | instance Measured v a => Semigroup (FingerTree v a) where
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@kowey
kowey / gist:7583016
Last active December 28, 2015 23:59
#!/usr/bin/python
# -*- coding: utf-8 -*-
# @author Eric Kow
# LICENSE: BSD3 (2013, Université Paul Sabatier)
"""
Standalone parser for PDTB files.
The function `parse` takes a single .pdtb file and returns a list
of `Relation`, with the following subtypes:
@kowey
kowey / gist:7580466
Last active December 28, 2015 23:39
import funcparserlib.parser as fp
const = lambda x: lambda _: x
unarg = lambda f: lambda x: f(*x)
_any = fp.some(const(True))
def cons((x,xs)):
return [x] + xs
@kowey
kowey / a.markdown
Last active December 27, 2015 07:39
  1. create ~/.vim/plugin/kowey-bufmenu.vim by copying/patching your system vim/runtime/menu.vim
  2. edit your ~/.vimrc (not .gvimrc!), and insert let no_buffer_menu=1 BEFORE any set syntax directives (apparently they trigger the menu)
--- a/hints/darwin.sh 2013-05-08 11:13:45.000000000 -0600
+++ b/hints/darwin.sh 2013-05-08 11:15:04.000000000 -0600
@@ -129,7 +129,7 @@
# Avoid Apple's cpp precompiler, better for extensions
if [ "X`echo | ${cc} -no-cpp-precomp -E - 2>&1 >/dev/null`" = "X" ]; then
- cppflags="${cppflags} -no-cpp-precomp"
+ #cppflags="${cppflags} -no-cpp-precomp"
# This is necessary because perl's build system doesn't
@kowey
kowey / a2
Last active December 27, 2015 00:29
building subversion (with perl bindings) with nix on Mac
/nix/store/y3x7hzdn3363xjz4snaws9glxq3s7732-perl-5.16.3$ grep cpp-precomp -R .
./lib/perl5/5.16.3/darwin-2level/Config_heavy.pl:ccflags='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector'
./lib/perl5/5.16.3/darwin-2level/Config_heavy.pl:cppflags='-no-cpp-precomp -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector'
./lib/perl5/5.16.3/darwin-2level/Config_heavy.pl:ccflags_nolargefiles='-fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -pipe -fstack-protector'
@kowey
kowey / gist:7232615
Last active December 26, 2015 23:48

nix packages

cairo-1.12.16
dos2unix-5.3.1
git-1.8.4-full
libxml2-2.9.0
mercurial-2.6.1
msmtp-1.4.31
ncftp-3.2.5

nix-1.6.1

@kowey
kowey / gist:7232228
Last active December 26, 2015 23:39
$ dot 1.dot -T png
dyld: lazy symbol binding failed: Symbol not found: _cairo_quartz_font_face_create_for_cgfont
Referenced from: /nix/store/xbbaz0qyjcqp0pgnhw6akdwnws74b2yr-pango-1.32.5/lib/libpangocairo-1.0.0.dylib
Expected in: flat namespace
dyld: Symbol not found: _cairo_quartz_font_face_create_for_cgfont
Referenced from: /nix/store/xbbaz0qyjcqp0pgnhw6akdwnws74b2yr-pango-1.32.5/lib/libpangocairo-1.0.0.dylib
Expected in: flat namespace
Trace/BPT trap: 5
@@ -520,7 +520,7 @@
minput <- do
set sembox [ text :~ trim ]
loadEverything pstRef wrangler
- customSemParser wrangler . T.pack <$> get sembox text
+ customSemParser wrangler . unautocorrect . T.pack <$> get sembox text
case minput of
Left e -> errorDialog f "Please give me better input" (show e)
Right semInput -> do
@@ -537,6 +537,10 @@