Skip to content

Instantly share code, notes, and snippets.

fizzbuzz::Int->String
fizzbuzz n | (mod n 3)==0 && (mod n 5)==0 = "FizzBuzz"
| (mod n 3)==0 = "Fizz"
| (mod n 5)==0 = "Buzz"
| otherwise = show n
main = do
print $"3="++(fizzbuzz 3)
print $"4="++(fizzbuzz 4)
print $"5="++(fizzbuzz 5)
@Riduidel
Riduidel / resume.json
Last active November 22, 2019 18:28
An attempt at using JSONResume
{
"basics": {
"name": "Nicolas Delsaux",
"label": "Développeur",
"picture": "",
"email": "[email protected]",
"phone": "07 69 99 61 17",
"summary": "Dévelopeur expérimenté, presque expert",
"website": "http://riduidel.wordpress.com",
@Riduidel
Riduidel / pom.xml
Created August 30, 2019 16:42
A part of pom.xml showing fizzed-watcher configuration
<plugin>
<groupId>com.fizzed</groupId>
<artifactId>fizzed-watcher-maven-plugin</artifactId>
<configuration>
<touchFile>target/watcher.docs.touchfile</touchFile>
<watches>
<watch>
<directory>${asciidoc.source.docs.directory}</directory>
</watch>
</watches>
@Riduidel
Riduidel / rrss2imap.email.enveloppe.jinja2
Created July 12, 2019 16:40
rrss2imap.email.enveloppe.jinja2
MIME-Version: 1.0
User-Agent: rss2email
Content-Transfer-Encoding: base64
To: {{to}}
Subject: {{title}}
Date: {{date}}
Content-Type: text/html; charset="{{charset}}"
{% for l in links %}X-RSS-Feed: {{l}}{%- endfor %}
{% for a in from %}From: {{a}}{%- endfor %}
@Riduidel
Riduidel / arabian_to_roman.kt
Created May 23, 2019 10:02
Une version Kotlin d'une solution vachement chouette au problème classique des nombres arabes exprimés avec des chiffres romains
val MAPPINGS = java.util.TreeMap(mapOf(1 to "I",
4 to "IV",
5 to "V",
9 to "IX",
10 to "X",
40 to "XL",
50 to "L",
90 to "XC",
100 to "C",
400 to "CD",
@Riduidel
Riduidel / DataMunging.java
Last active April 3, 2019 19:50
data munging
public class DataMunging {
public static void main(String[] args) throws IOException {
System.out.println(
Files.lines(Paths.get("weather.dat"))
.map(line -> line.trim())
.map(line -> line.split(" +"))
.filter(elements -> elements[0].matches("[0-9\\*]+"))
.map(elements -> new AbstractMap.SimpleEntry<>(elements[0],
Integer.parseInt(elements[1].replace("*", "")) - Integer.parseInt(elements[2].replace("*", "")
)))
@Riduidel
Riduidel / Converter.java
Created March 26, 2019 15:13
Un exemple de transformation en nombre romain
public class Converter {
private static class Bound {
public final int number;
public final char symbol;
public Bound(int number, char symbol) {
super();
this.number = number;
this.symbol = symbol;
}
}
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software