Skip to content

Instantly share code, notes, and snippets.

@hiteshjasani
hiteshjasani / jeromq_context_term_hang_bug.md
Last active November 20, 2015 13:09
Terminate context hang

Main Thread:

  • create context (zmq/context 1)
  • create workers and pass them the context
  • start the worker threads
  • addShutdownHook
    • shutdown the worker threads
    • join the worker threads
    • sleep 2s ;; without this line the terminate context sometimes hangs, with it so far it has never hung
    • terminate the context (.term context) ;; sometimes hangs here
@hiteshjasani
hiteshjasani / gist:135b186db1fe2eb6ab36
Last active August 29, 2015 14:07
Nim example of Haskell Maybe type
###############################
## Library code
type
TMaybeKind = enum
mkJust,
mkNothing
TMaybe[T] = object
case kind: TMaybeKind
of mkJust: val: T
@hiteshjasani
hiteshjasani / Editors.hs
Created September 29, 2014 23:42
Parsing html with Haskell
---------------------------------------------------------------
-- |
-- Module : Editors
-- Copyright : (c) Hitesh Jasani, 2007
-- License : BSD3
--
-- Maintainer : Hitesh Jasani <[email protected]>
-- Stability : provisional
-- Portability :
--
@hiteshjasani
hiteshjasani / readme.md
Last active May 31, 2018 21:34
Tmux conf

Sample commands working with tmux

# start tmux
% tmux new-session -s mysession

# detach from session
`d

# reattach to session