Skip to content

Instantly share code, notes, and snippets.

View JulienRouse's full-sized avatar

Julien Rousé JulienRouse

View GitHub Profile
@JulienRouse
JulienRouse / klipse.html
Last active May 9, 2019 15:09
Little table for employee with filtering. Use Reagent, Re-Frame and spec (and there is a klipse version for trying it out in the browser)
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="http://app.klipse.tech/css/codemirror.css">
<script>
window.klipse_settings = {
eval_idle_msec: 200, // idle time in msec before the snippet is evaluated
selector: '.clojure',// css selector for the html elements you want to klipsify

side note => Good post about REPL and starting with Clojure Bare minimum

Videos for the talks will be available soon

Clojure North 2019

Talks I went to (Day1)

  • Keynote: The Crux of Bitemporality: Jon Pither (Juxt) unveiled Crux the new database they have been working on at Juxt. The project aims to help with the problem of bitemporality, wich is when you have data with a createdDate and also a valideDate (or expiration date)
@JulienRouse
JulienRouse / clojure-java-interop.clj
Last active September 4, 2022 04:19
Notes about clojure-java interop for a Montreal Clojure Meetup lightning talk
;Montreal Clojure Meetup 2019
;;sources
; - https://clojure.org/reference/java_interop
; - https://leanpub.com/clojure-java-interop/read_sample
; - http://blog.jayfields.com/2011/12/clojure-java-interop.html
; - https://stackoverflow.com/questions/2181774/calling-clojure-from-java
; - https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.3.2-200
;Attempt at the puzzle of issue 316 of Eric Normand newsletter.
;
;Thanks @seancorfield for his help on the clojure slack channel with destructuring parameters in anonymous function
;to help clean the code
;Run-length encode a sequence
;Run-length encoding is a way to represent a sequence in a more compact form. Instead of saying :p :p :p, you say "3 :ps". Write a function that takes a sequence and returns that sequence with run-length encoding.
;(rle [:a :a :a :b :c :d :d :d :d])
;=> ([3 :a] [1 :b] [1 :c] [4 :d])
;Attempt at the puzzle of issue 316 of Eric Normand newsletter.
;https://purelyfunctional.tv/issues/purelyfunctional-tv-newsletter-316-avoid-licensing-and-support-issues-with-the-right-jdk-for-you/
;Drop every nth element from a sequence
;The problem is simple: write a function that takes a number n and a sequence.
;The function returns a new sequence with every nth element removed.
;(drop-every 3 [:a :b :c :d :e :f :g])
;=> (:a :b :d :e :g)
@JulienRouse
JulienRouse / GeometricTrick.java
Created May 23, 2017 14:22
Using list of divisor
public static int geometricTrickv2(String s){
Set<Integer> indexA = new HashSet<>(s.length());
Set<Integer> indexC = new HashSet<>(s.length());
List<Integer> indexB = new ArrayList<>();
for(int i=0;i<s.length();i++){
if(s.charAt(i)=='a')
@JulienRouse
JulienRouse / GeometrickTrick.java
Created May 23, 2017 11:58
Algo naive for GeometricTrick challenge
/**
* Consider a string s of length n with alphabet {a,b,c}.
* We look for the number of different triplet (i,j,k) where 0<=i,j,k<n, satisfying!
* - s[i] = "a", s[j] = "b", s[k] = "c"
* - (j + 1)² = (i + 1)(k + 1)
* @param s A string we look the triplet in
* @return Number of different triplets such as enonced above.
*/
public static int geometricTrick(String s){
;;;; draw-string.asd
(asdf:defsystem #:draw-string
:description "Describe draw-string here"
:author "Your Name <your.name@example.com>"
:license "Specify license here"
:depends-on (#:xelf)
:serial t
:components ((:file "package")
(:file "draw-string")))
@JulienRouse
JulienRouse / draw-string.asd
Created September 19, 2016 15:00
xelf:draw-string
;;;; draw-string.asd
(asdf:defsystem #:draw-string
:description "Describe draw-string here"
:author "Your Name <your.name@example.com>"
:license "Specify license here"
:depends-on (#:xelf)
:serial t
:components ((:file "package")
(:file "draw-string")))