Skip to content

Instantly share code, notes, and snippets.

View jonashaag's full-sized avatar

Jonas Haag jonashaag

View GitHub Profile
diff --git a/src/Diagrams/Backend/Cairo/Internal.hs b/src/Diagrams/Backend/Cairo/Internal.hs
index d1de7ef..671f1ae 100644
--- a/src/Diagrams/Backend/Cairo/Internal.hs
+++ b/src/Diagrams/Backend/Cairo/Internal.hs
@@ -8,6 +8,7 @@
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE ViewPatterns #-}
+{-# LANGUAGE StandaloneDeriving #-}
Wed Feb 12 21:41 2014 Time and Allocation Profiling Report (Final)
Test +RTS -prof -RTS 20
total time = 9.02 secs (9020 ticks @ 1000 us, 1 processor)
total alloc = 5,308,057,560 bytes (excludes profiling overheads)
COST CENTRE MODULE %time %alloc
mult Data.Colour.Matrix 23.2 31.0
@jonashaag
jonashaag / Demo.hs
Created March 5, 2014 13:32
diagrams-gtk plane vs. text
module Demo where
import Diagrams.Prelude
import Diagrams.Backend.Cairo
import Diagrams.Backend.Gtk
import Graphics.UI.Gtk
import Graphics.Rendering.Cairo (liftIO)
main = do
import Data.Tree
import Diagrams.Prelude
import Diagrams.TwoD.Layout.Tree
import Diagrams.Backend.SVG.CmdLine
t1 = Node 'A' [Node 'B' (map lf "CDE"), Node 'F' [Node 'G' (map lf "HIJ")]]
where lf x = Node x []
exampleSymmTree :: Diagram B R2
exampleSymmTree = foldl1 (|||) (map renderWithSep [0.5..5])
require 'formula'
class Libmp3splt < Formula
homepage 'http://mp3splt.sourceforge.net'
url 'https://downloads.sourceforge.net/project/mp3splt/libmp3splt/0.9.1a/libmp3splt-0.9.1a.tar.gz'
sha1 '189ecef22274d599f8503e77da26c7a27264d740'
bottle do
sha1 "cd939c062ad24486c1414236ed8501b9fc5307de" => :mavericks
sha1 "2ea059a18c4bcfc9bfbed32874ad60e363b908e1" => :mountain_lion
diff -ur -x '*.pyc' django-django-a9fa3d4/django/core/checks/compatibility/django_1_6_0.py tb123-django-553c91a/django/core/checks/compatibility/django_1_6_0.py
--- django-django-a9fa3d4/django/core/checks/compatibility/django_1_6_0.py 2014-08-03 02:02:06.000000000 +0200
+++ tb123-django-553c91a/django/core/checks/compatibility/django_1_6_0.py 2014-08-08 01:20:16.000000000 +0200
@@ -10,7 +10,7 @@
def check_1_6_compatibility(**kwargs):
errors = []
errors.extend(_check_test_runner(**kwargs))
- errors.extend(_check_boolean_field_default_value(**kwargs))
+ #errors.extend(_check_boolean_field_default_value(**kwargs))
return errors
let p n = n (+1) 0
let zero f x = x
let succ n f x = f (n f x)
let mult m n f = n (m f)
let dx = succ
-- base case
λ p $ square (succ (succ zero))
4
"""Experimental implementation of a git 'block history' log, that is, the history
of all changes made to a certain _named_ program block (class, def).
Blocks are identified in the source code by their fully qualified names::
# test_module.py
class Foo:
def bar(self):
if ...:
...
@jonashaag
jonashaag / parse-gnu-global.py
Last active February 8, 2016 08:43
Parser for gnu global output
import re
import urllib
import subprocess
import collections
def drop_dupes(iterator):
return collections.OrderedDict.fromkeys(iterator).keys()
def read_lines(path):
@jonashaag
jonashaag / 0-skip-unittest-base-class.py
Last active December 5, 2022 16:18
Python unittest base class skipper
def test_base(base_cls):
class BaseClassSkipper(base_cls):
@classmethod
def setUpClass(cls):
if cls is BaseClassSkipper:
raise unittest.SkipTest("Base class")
super().setUpClass()
return BaseClassSkipper