Skip to content

Instantly share code, notes, and snippets.

Avatar

Steffen Siering urso

  • Xata
  • Berlin, Germany
View GitHub Profile
@urso
urso / go-gdb-extra.py
Last active Sep 8, 2017
add 'allgroutines <cmd>' to gdb (e.g. `(gdb) allgroutines bt`)
View go-gdb-extra.py
from __future__ import print_function
""" GDB 'allgoroutines' command for executing gdb command within the context of every goroutine at once """
class GoroutineStacks(gdb.Command):
"Print stacktrace for all goroutines."
def __init__(self):
gdb.Command.__init__(self, "allgoroutines", gdb.COMMAND_STACK, gdb.COMPLETE_NONE)
View expvar_rates.py
import requests
import argparse
import time
import curses
def main():
parser = argparse.ArgumentParser(
description="Print per second stats from expvars")
parser.add_argument("url",
@urso
urso / gist:1034341
Created Jun 19, 2011
ConTeXt rotated table example
View gist:1034341
\setuppapersize[A4][A4]
\setuplayout[location=middle, marking=on,
header=1.5em,
topspace=2cm, headerdistance=1.5cm,
backspace=3.2cm, cutspace=3.5cm,
bottomdistance=1cm, height=middle, width=middle,
leftmargindistance=0.25cm, rightmargindistance=0.25cm,
leftedgedistance=1.5cm, rightedgedistance=0cm,
leftedge=0cm, rightedge=1cm,
leftmarginwidth=2cm, rightmargin=3cm]
@urso
urso / gist:762647
Created Jan 2, 2011
example corentins evaluator
View gist:762647
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE GADTs, StandaloneDeriving#-}
import Control.Applicative
import Control.Arrow
import Control.Monad.Identity
import Data.Typeable
type PlayerNumber = Int
@urso
urso / gist:666121
Created Nov 7, 2010
AwesomePrelude example with associated data families
View gist:666121
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
module MyLang where
import Prelude (($),(.))
import qualified Prelude as P
@urso
urso / gist:666119
Created Nov 7, 2010
AwesomePrelude example
View gist:666119
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE GADTs #-}
module MyLang where
import Prelude (Integer(..), Show(..),String(..))
import qualified Prelude as P
View gist:614246
{-# LANGUAGE OverlappingInstances #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE MultiParamTypeClasses #-}
{-# LANGUAGE PackageImports #-}
import Control.Applicative (Applicative,(<*>),(<$>),pure)
import Control.Monad (ap,join)
import "mtl" Control.Monad.Trans (liftIO)
import "mtl" Control.Monad.Reader (ReaderT,runReaderT,ask)