Skip to content

Instantly share code, notes, and snippets.

@openglx
openglx / rimeann_project.clj
Created May 15, 2017 14:07
Strange Riemann project behaviour when running on test mode
;
; test with: riemann test filename.clj
;
(let [add-to-index (tap :index-tap (index))]
(streams
(project [(service "a") (service "b")]
(fn [events]
(let [how-many (count (remove nil? events))]
(add-to-index {:time 0 :how-many how-many}))))))
@openglx
openglx / gist:1812531
Created February 13, 2012 01:44
MyImageMenuItem extending WMenu
/*****************************************************************************/
/* my implementation of WMenu using thumbnail images as link */
class MyImageMenuItem : public Wt::WMenuItem
{
public:
MyImageMenuItem(Wt::WImage* img, Wt::WWidget *contents,
Wt::WMenuItem::LoadPolicy policy = Wt::WMenuItem::LazyLoading);
protected:
void updateItemWidget(Wt::WWidget *itemWidget);
Wt::WWidget *createItemWidget();