Skip to content

Instantly share code, notes, and snippets.

View xificurC's full-sized avatar

Peter Nagy xificurC

  • Hyperfiddle Inc.
View GitHub Profile
(ns defwrapper
(:require [clojure.string :as str]))
(set! *warn-on-reflection* true)
(defn class-methods [^Class class]
(seq (.getMethods class)))
(defn constructors [^Class klazz]
(.getDeclaredConstructors klazz))
@padewitte
padewitte / CamelMongoDBCursorExample.groovy
Last active November 27, 2018 10:28
Quick example of a Camel route using the DBCursor outputype with a MongoDB endpoint
/*
* Demonstration of the new MongoDB outypeType attribute in Camel 2.16.
* Priorir to launching script lower the maximum ram available for groovy by setting maximum size to 664M `export JAVA_OPTS="$JAVA_OPTS -Xmx64M"`.
* MongoDB should run localy with no security on test database otherwise change the mongoClient initialization.
* First feed the base by running the script with FEED parameter ( groovy CamelMongoDBCursorExample.groovy FEED )
* Try to list all document by running the script with LIST parameter ( groovy CamelMongoDBCursorExample.groovy LIST ). You should face a OutOfMemory error.
* Run again with CURSOR parameter ( groovy CamelMongoDBCursorExample.groovy CURSOR ) all documents are print in the console.
*
* ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
@iamnewton
iamnewton / bash-colors.md
Last active April 12, 2024 10:58
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple