Code examples knowledge base
- Generated by code-examples-manager
- The origin of this tool comes from this talk
- Originally presented at AlpesCraft 2019
- The origin of this tool comes from this talk
- 240 published examples
Without category
- cats-first-try.sc : First use of cats API.
- cmdline-parser.sc : command line options parser
- gatling-simple.sc : Just ONE ammonite script file to execute a load performance test using gatling !
- java-scripting.jsh : java hello world script
- ssh-client-server-sync.sc : SSH server and client operations both within a single script using apache sshd.
akka
- akka-actors-hello-world.sc : Simple akka hello world example
- akka-http-client-json-stream.sc : Fully asynchronous http client call with json streamed response using akka-http will work in all cases, even with chunked responses !
- akka-http-client-json-with-proxy.sc : Fully asynchronous http client call with json response using akka-http will work in all cases, even with chunked responses, this example add automatic http proxy support.
- akka-http-client-json.sc : Fully asynchronous http client call with json response using akka-http will work in all cases, even with chunked responses !
- akka-http-client-simple-with-proxy.sc : Fully asynchronous http client call using akka-http will work in all cases, even with chunked responses, this example add automatic http proxy support.
- akka-http-client-simple.sc : Fully asynchronous http client call using akka-http will work in all cases, even with chunked responses !
- akka-http-client-websocket-hello-world.sc : playing with websockets using akka-http
- akka-http-client-websocket-typed-actor-graph.sc : Dump incoming websockets content
- akka-http-server-static-files-with-shutdown.sc : Simplest static resources http server example using akka-http framework with shutdown support and root redirect.
- akka-http-server-static-files.sc : Simplest static resources http server example using akka-http framework.
- akka-http-server-websocket-counter.sc : akka websocket counter service, just increment a counter every second for each connected client
- akka-http-server-websocket-echo.sc : akka websocket echo service
- akka-typed-actors-hello-world.sc : Playing with akka-typed
- capitalise-and-print.sc : send stdin lines to websocket and dump (asynchronously) everything coming from the websocket to stdout
- wscat-stream.sc : send stdin lines to websocket and dump (asynchronously) everything coming from the websocket to stdout
- wscat.sc : send stdin lines to websocket and dump (asynchronously) everything coming from the websocket to stdout
algos
- algo-bfs.sc : Playing with Breadth first search (bfs) algorithm.
- algo-coordinates-encoding.sc : encode (x,y) coordinates in a single int
- algo-coordinates-hexagons-grids.sc : hexagons and grids coordinates conversions
- algo-dfs.sc : Playing with depth first search (dfs) algorithm.
- algo-kadane.sc : Maximum subarray problem
- algo-paths-to-tree.sc : convert a list of paths into a tree
- algo-solution-brute-force.sc : all possible solutions generator, can be used to brute force passwords, hashes, ...
- algo-solutions-combinations-list.sc : given a list of entities and goals find all possible goals/entities associations where a goal can only be used once
- algo-trees.sc : Playing with trees and distances between nodes
- algo-vector4-encoding.sc : encode/decode 4 component vector into an integer
apps
- README.md : Standalone launchers for my opensource applications
- cem.sc : code examples manager application launcher script
- cem.sh : code examples manager application launcher shell script
- lorem-alt.sc : lorem ipsum generator web service
- lorem-lib.sc : lorem ipsum generator
- lorem.sc : lorem-ipsum web service launcher script
- lorem.sh : lorem-ipsum web service launcher shell script
- primes.sc : primes web service launcher script
- primes.sh : primes web service launcher shell script
- spy.sc : spy web service launcher script
- spy.sh : spy web service launcher shell script
- web-echo.sc : web-echo web service launcher script
- web-echo.sh : web-echo web service launcher shell script
artificial-intelligence/djl
- README.md : Notes about DJL - Deep Java Library
- object-detection.sc : thing (objects, people, animals) detection using DJL
- tutorial-01.sc : Playing with DJL, tutorial-01
- tutorial-02.sc : Playing with DJL, tutorial-02
- tutorial-03.sc : Playing with DJL, tutorial-03
- tutorial-full.sc : Playing with DJL, tutorial-02 & tutorial-03 combined
artificial-intelligence/drools
- drools-backward-simple.sc : Simple drools backward chaining example.
- drools-basics-json.sc : Basic drools usage examples through unit test cases.
- drools-basics.sc : Basic drools usage examples through unit test cases.
- drools-equality.sc : Drools equality behavior and customization thanks to the
key
annotation. - drools-hello-world-revisited.sc : Drools Hello world revisited
- drools-hello-world-small.sc : Drools Hello world
- drools-hello-world.sc : Drools Hello world
- drools-insertLogical-aggregate-expires.sc : Understanding insertLogical, aggregates in the context of drools events reasoning, keeping up to date a computed value
- drools-interactions-enhanced.sc : Drools web based user interactions with a performance diagnostic knowledge base
- drools-interactions-gatling.sc : drools interactions performance test script
- drools-interactions.sc : Drools web based user interactions with a performance diagnostic knowledge base
- drools-kb-advanced-understanding.sc : Drools advanced understanding rules knowledge base
- drools-kb-banking-advanced.sc : Enhanced drools example banking application wired to a kafka topic
- drools-kb-banking-events-stream-generator.sc : Start an embedded kafka and provide simple way to generate simple banking events
- drools-kb-banking-skeleton.sc : Drools banking skeleton application wired to a kafka topic
- drools-kb-banking.sc : Drools banking example application wired to a kafka topic
- drools-kb-doctor.sc : Drools family knowledge base
- drools-kb-errors-management.sc : Drools knowledge base error management
- drools-kb-events-understanding.sc : Drools understanding events base knowledge base
- drools-kb-family.sc : Drools family knowledge base
- drools-kb-forever-loop-on-modify.sc : Drools rules loop knowledge base
- drools-kb-forever-loop.sc : Drools forever loop knowledge base
- drools-kb-official-examples-games.sc : Drools official examples launcher examples
- drools-kb-official-examples-simple-with-pauses.sc : Drools step by step FireKB example
- drools-kb-official-examples-simple.sc : Drools official minimalist FireKB example
- drools-kb-official-examples.sc : Drools official examples unit tests, it list all example knowledge base names
- drools-kb-pets.sc : Drools family knowledge base
- drools-kb-reasoning-forward-chaining-enhanced.sc : Drools forward chaining example knowledge base with roots from wikipedia definition example
- drools-kb-reasoning-forward-chaining.sc : Drools forward chaining example knowledge base with roots from wikipedia definition example
- drools-kb-understanding-constraints-limitations.sc : Drools constraints analysis
- drools-kb-understanding.sc : Drools understanding rules knowledge base
- drools-parsing-issues.sc : Drools parsing issues
- drools-persistence.sc : Learn to use drools working memory persistence to disk.
- drools-spark-hello-world.sc : Drools spark hello world knowledge base
- drools-with-case-classes.sc : Drools ammonite case class support ?
artificial-intelligence/drools/just-kbs
- kb-doctor.drl : A simplified doctor knowledge base.
artificial-intelligence/smile
- README.md : Notes about Smile - Statistical Machine Intelligence and Learning Engine
- cal_housing.sc : Playing with smile and california housing dataset
- iris.sc : Playing with smile and iris dataset
- visualization-swing-hist.sc : smile visualization histograms
- visualization-swing-linechart.sc : smile visualization line charts
- visualization-swing-qqplot.sc : smile visualization qqplot
- visualization-swing-scatter.sc : smile scatter visualization
- visualization-vega-scatter.sc : smile scatter visualization
bash
- amm-update.sh : Very simple ammonite upgrade script.
- bash-date-formatted.sh : Generates a simple timestamp.
- bash-date-iso8601-formatted.sh : Generates a simple timestamp.
- bash-printf.sh : bash printf example with float rounding
- bash-ssh-gitlab-agent-import-key.sh : ssh agent automatic provisioning using a ssh private key initialized through an environment variable.
- bash-uuid.sh : bash uuid
- curl-post-json.sh : post json using curl
- diaporama.sh : photos diaporama
- http-alive-wait.sh : wait for a http end point to become available
cem
- learn-gists-api-1-list.sc : List a user github gists using sttp for client http and circe for json processing.
- learn-gists-api-2-list-json4s.sc : List a user github gists using sttp for client http and json4s for json processing.
- learn-gists-api-3-oauth-list.sc : List a user github gists using sttp for client http API.
- learn-gists-api-4-oauth-list-link-advanced.sc : List a user github gists using sttp for client http and circe for json processing with authentication.
- learn-gists-api-5-oauth-list-link-json4s.sc : Various operations on gists using sttp for client http and json4s for json processing with authentication.
- poc-1-examples-manager.sc : Publish code examples to remote repositories solutions (DEPRECATED see https://github.com/dacr/code-examples-manager).
- poc-2-gists-manage.sc : Publish code sample as github gist (DEPRECATED see https://github.com/dacr/code-examples-manager).
cem/tests
- cem-gist-test-3.md : testing cem #5
codecs-serdes-hashes
- base64.sc : encode/decode base64 with charset management
- hashes.sc : Various programmatic hashes.
- object-persistence.sc : Using standard java object persistence mechanism.
doodle
- vectorgraphics-doodle-basics.sc : Playing basics vector graphics using doodle library.
- vectorgraphics-doodle-circles-2.sc : Drawing again circles using doodle library.
- vectorgraphics-doodle-circles.sc : Drawing circles using doodle library.
- vectorgraphics-doodle-example-interact.sc : Drawing embedded examples using doodle library.
- vectorgraphics-doodle-examples.sc : Drawing embedded examples using doodle library.
- vectorgraphics-doodle-labyrinth.sc : Drawing a labyrinth using doodle library.
- vectorgraphics-doodle-simplest.sc : Smallest doodle example.
elasticsearch
- elasticsearch-demo-1-startup-minimal.sc : Elasticsearch minimal startup for test, experiences, proof of concept purposes.
- elasticsearch-demo-1-startup.sc : Elasticsearch startup for test, experiences, proof of concept purposes.
- elasticsearch-demo-2-basictests-embedded-mode.sc : Basic elastic4s (scala API for elasticsearch) tests using elasticsearch-cluster-runner.
- elasticsearch-demo-3-fill-with-spark.sc : Feed elasticsearch with almost 20 years of chicago crimes (using spark).
- elasticsearch-demo-3-fill.sc : Feed elasticsearch with almost 20 years of chicago crimes.
- elasticsearch-demo-cluster-1-startup.sc : Elasticsearch startup for test, experiences, proof of concept purposes.
- elasticsearch-demo-cluster-3-fill-cluster.sc : Feed elasticsearch with almost 20 years of chicago crimes.
- elasticsearch-demo-tests.sc : Basic elastic4s (scala API for elasticsearch) tests using elasticsearch-cluster-runner.
- elasticsearch-stock-timeseries-generator.sc : Generate stock time series
fdj
- euromillions-random-generator.sc : generate a random euromillions play
http
- http-client-requests-simple.sc : http client using requests API
- http-client-sttp-json-simple-akkahttp.sc : Simplest sttp http client library json example using akkahttp backend.
- http-client-sttp-json-simple.sc : Simplest sttp http client library json example.
- http-client-sttp-simple.sc : Simplest sttp http client library example.
- http-web-linking.sc : lazy generic http web linking
io
- filesio-betterfiles-basics.sc : Using scala betterfiles API to simplify operations with files.
- filesio-default-basics.sc : Using scala default API for operations with files.
json
- json-borer.sc : borer scala json API cookbook as unit test cases.
- json-circe.sc : Circe scala json API cookbook as unit test cases.
- json-genson.sc : genson java json API cookbook as unit test cases.
- json-jawn-json4s.sc : typelevel jawn scala json API cookbook as unit test cases.
- json-json4s.sc : Json4s scala json API cookbook as unit test cases.
- json-upickle.sc : upickle scala json API cookbook as unit test cases.
julia
- hello-world.jl : hello world julia script
- logging.jl : logging with julia
- testing-unittests-1.jl : julia unit testing
- testing-unittests-2.jl : julia enhanced unit testing
- uuidgen.jl : julia uuid generator
kafka
- kafka-client-simple.sc : Kafka simple usage using java API
- kafka-embedded-features.sc : Kafka features test using embedded kafka.
- kafka-embedded-hello.sc : Hello world embedded kafka test script using scalatest-embedded-kafka.
- kafka-raspberrypi-publish-temperatures.sc : publish raspberry pi 1-wire DS18B20 temperature sensors to a remote secured kafka
- kafka-stream-simple.sc : simple kafka stream example
logging
- logging-enhancement-experiment.sc : Experimenting scala logging approach.
- logging-generator-application-logs.sc : Application random logs generator, with multi-line entries
- logging-testing.sc : Playing/testing with logback configuration.
- logging-tips.sc : logging tips with log4j2 and slf4j
maths
- math-beal-conjecture.sc : Beal conjecture / conjecture de Beal.
- math-benford-law-1.sc : Benford law experiments
- math-collatz-conjecture.sc : Collatz conjecture / conjecture de syracuse.
- math-combs-perms-and-co.sc : permutations combinations and co
- math-computes-with-same-number.sc : Numbers which can be computed with the same figure
- math-e.sc : compute exponential e high precision value
- math-fact.sc : almost no size limit fact compute
- math-gaussian-functions.sc : gaussian simple function drawn using breeze
- math-lcm-gcd.sc : lcm and gcd
- math-logistic-map-1.sc : the logistic map / La suite logistique
- math-logistic-map-2.sc : the logistic map - bifurcation diagram / La suite logistique - diagramme de bifurcation
- math-pi-plouffe.sc : compute a high precision value of pi
- rng-basic-fast-random.sc : Compare homogeinity of some simple custom random generators using doodle (increase XSS !!)
- simu-monty-hall-paradox.sc : Monty Hall paradox simulation (probability puzzle)
- simu-random-variations-behavior.sc : plotting random series variations as an attempt to illustrate mandelbrot (un)wild chance
network
- dns.sc : playing with dnsjava api
- host.sc : resolve host name
- my-ips.sc : get my local IPs and my remote IPs
- netio-remote-check.sc : Testing if a remote http server is reachable.
opendata
- opendata-postalcodes-2.sc : postal code opendata data sources.
- opendata-postalcodes.sc : First try with open-data data sources with ssl certificate hacks
plotting
- plotting-breeze-simple-1.sc : first example with the breeze data visualization
- plotting-breeze-simple-2.sc : breeze visualization example
- plotting-nspl-simple.sc : first example with a new scala plotting library (nspl)
- plotting-plotly-multiplots.sc : Playing with plotly through plotly-scala - multiplots
- plotting-plotly-simple-timeseries-multiY.sc : Playing time series with plotly through plotly-scala.
- plotting-plotly-simple-timeseries.sc : Playing time series with plotly through plotly-scala.
- plotting-plotly-simple.sc : Playing with plotly through plotly-scala.
- plotting-smile-simple-1.sc : plotting with smile
python
- cem-word-cloud.py : display examples keywords frequency cloud tags graph
- tcp-port-check.py : just check if a network tcp port is accessible
rabbitmq
- rabbitmq-learning.sc : learning rabbitmq through java api.
repos
- ammonite-add-external-repository.sc : Customize ammonite repositories.
scala-java-kb
- binary-operations.sc : various binary operations (cheat sheet)
- collection-operations.sc : collection operations on strings
- file-path-tools.sc : various file and path helper functions
- java-basics-async.sc : java futures
- java8time.sc : java8 time api usage examples.
- scala-algebric-data-types.sc : scala algebric data types
- scala-autoclose.sc : Auto close/dispose resource
- scala-basics-async.sc : scala asynchronous operations
- scala-basics.sc : scala language
- scala-chaining.sc : Using scala new chaining capabilities
- scala-howlong.sc : Simple operations duration tools.
- scala-implicit-class.sc : implicit class scala feature.
- scala-list-resources.sc : scala list available resources.
- string-operations.sc : Advanced operations on strings with regular expressions and/or pattern matching
- xml-basics.sc : simple scala xml operations
security
- basic-auth-token.sc : small function to generate a basic authentication Authentication token
- basic-auth-token.sh : small function to generate a basic authentication Authentication token
spark
- spark-csv-load.sc : Load and process CSV content using spark.
- spark-hello.sc : spark hello world.
stocks
- ca-csv-processings-simple-1.sc : Simple stock processing to compute global earnings and stock palmares
- ca-csv-to-json-stock.sc : Converting CA stock operations histories into JSON
- stock-get-from-boursorama.sc : Extract stock data fro boursorama
- tmbom-dji-1-download.sc : Download DJI historical data - The (mis) behavior of markets : A fractal view of Risk, Ruin and Reward - Benoît Mandelbrot
- tmbom-dji-2-process.sc : Visualize DJI historical data - The (mis) behavior of markets : A fractal view of Risk, Ruin and Reward - Benoît Mandelbrot
storage/arangodb
- README.md : basic thing to know about arangodb and graphql
- arangodb-javadriver-basics-1.sc : playing with arangodb using java driver and genson serdes
- arangodb-javadriver-basics-2.sc : playing with arangodb using java driver and native serdes
- arangodb-javadriver-basics-3.sc : playing with arangodb using java driver and json4s serdes
- arangodb-javadriver-graph-basics-1.sc : playing with arangodb graph using java driver and json4s serdes
- arangodb-javadriver-learning-as-tests-basics.sc : learning arangodb through java client driver
- arangodb-javadriver-learning-as-tests-graphs.sc : learning arangodb graphs features through java client driver
- arangodb-javadriver-learning-as-tests-serdes.sc : learning arangodb serialization / deserialization using the java client driver
- arangodb-primes-feed.sc : Create arangodb primes number dataset
- arangodb-primes-queries.sc : arangodb primes number queries
- arangodb-proteus-basics.sc : playing with arangodb using scarango client library
systemd
- alive-teller.service : simple alive service based on systemd (service part)
- alive-teller.timer : simple alive service based on systemd (timer part)
- simple.service : Simple way to create a systemd service with a blocking command
testing
- testing-pi-2.sc : simple scalatest test framework usage.
- testing-pi-3.sc : simple scalatest test framework usage with durations.
- testing-pi-calculus.sc : Compute PI using montecarlo approach, i.e. using a random generator.
- testing-pi.sc : Simplest scalatest test framework usage.
- testing-scalatest.sc : various scalatest usage examples.
- testing-selenium-with-autoproxy.sc : Playing with scalatest selenium integration to test remote sites with automatic http proxy support.
- testing-selenium.sc : Playing with scalatest selenium integration to test remote sites.
- testing-stdout.sc : How to test the console output of a function or method ?
- testing-with-docker.sc : scala with docker testing using docker-testkit library.
tools
- date-iso8601.sc : Simple script to generate an ISO8601 date.
- uuid-generator.sc : Simple script to generate an UUID.