Skip to content

Instantly share code, notes, and snippets.

@jido
jido / clock.r
Last active April 16, 2022 20:18
EST becomes EDT
> library(clock)
> x <- as.POSIXct("2020-11-01 00:30:00", "America/New_York")
> x <- add_hours(x, 0:2)
> x
[1] "2020-11-01 00:30:00 EDT" "2020-11-01 01:30:00 EDT"
[3] "2020-11-01 01:30:00 EST"
> add_years(x, 1)
[1] "2021-11-01 00:30:00 EDT" "2021-11-01 01:30:00 EDT"
[3] "2021-11-01 01:30:00 EDT"
> add_years(x, -1)
@jido
jido / day4-cleanup.do0
Created December 8, 2022 20:43
Advent of Code day 4 solution in Dodo0 language
clojure('read-line', 0) -> readline
clojure('split', 2) -> split
clojure('nil?', 1) -> endOfFile
clojure('read-string', 1) -> asInt
fun loop -> count, break
(
readline() -> line
endOfFile(line) -> eof
if (eof) ->
# Imported Clojure functions
clojure('<=', 2) -> lte
clojure('dec', 1) -> dec
# Fibonacci function (recursive)
# Takes advantage of dodo ability to return more than one result at once
fun fib -> n, return, throw
(
'<='(n, 0) -> zero
if (zero) ->
@jido
jido / Ce pourquoi l-on chante.md
Last active March 4, 2025 08:11
Why we sing, French version

Ce pourquoi l'on chante

Titre original: Why we sing

Auteur: Gregory L Gilpin (ASCAP)

Adaptation: Denis Bredelet

 Une note d'espoir
@jido
jido / I love her to death.md
Created February 7, 2025 23:18
Je l'aime à mourir, English version

I love her to death

Original title: Je l'aime à mourir

Author: Francis Cabrel

Adaptation: Denis Bredelet

 I was nobody and
@jido
jido / No sleep.md
Last active February 8, 2025 00:04
Stromae's Sommeil, English version

No sleep

Original title: Sommeil

Author: Stromae

Adaptation: Denis Bredelet

 You can say anything you like