Skip to content

Instantly share code, notes, and snippets.

View doublefx's full-sized avatar

Frédéric THOMAS doublefx

  • Paris
  • 17:08 (UTC +01:00)
View GitHub Profile
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checkstyle configuration that checks the Google coding conventions from Google Java Style
that can be found at https://google.github.io/styleguide/javaguide.html.
Checkstyle is very configurable. Be sure to read the documentation at
@doublefx
doublefx / scratch_20.java
Last active January 22, 2022 14:18
Find a directory with the max number of files
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Objects;
import java.util.function.Predicate;
import java.util.stream.Stream;
@doublefx
doublefx / main.go
Last active January 17, 2022 11:36
Goland Coffee-Machine with disposable cup size management
package main
import (
. "fmt"
)
const (
WithPrompt = true
BUY = "buy"
FILL = "fill"
####
# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
#
# Before building the container image run:
#
# mvn package
#
# Then, build the image with:
#
# docker build -f src/main/docker/Dockerfile.fast-jar -t quarkus/dci-quarkus-pi-fund-persistence-service-fast-jar .
module Main (
main
) where
import Data.List.Split
import System.Random
check :: String -> String -> Char -> (Bool, String)
-- check whether a single char is in the mystery word
check secretWord displayWord inputChar
// debug is never used.
// Wouldn't have been better to use and return a checked List interface instead of uncheck implementations ?
// Are we sure we return the OFFLINE user devices here ?
public LinkedList getOfflineDevicesForUser(User user, boolean debug) {
// Why not using the LinkedList implementation directly ?
ArrayList l = new ArrayList();
// Why to use an unchecked List instead of List<Device> ?
// Isn't there any conventions to use the i, j, k suite for counter variables instead of x, y, z ?
package com.britishgas.homework;
import junitparams.JUnitParamsRunner;
import junitparams.Parameters;
import org.junit.Test;
import org.junit.runner.RunWith;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
always(alwaysCallback1?: JQueryPromiseCallback<any>, ...alwaysCallbacksN: Array<JQueryPromiseCallback<any>>): JQueryDeferred<T>;
@doublefx
doublefx / BrowserEvent.as
Created August 11, 2015 13:30
BrowserEvent
/**
* Licensed 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
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
package {
import flash.events.ErrorEvent;
public class HtmlContainer {
COMPILE::JS
private static function loadScripts(scripts:Array, onLoaded:Function = null):void {
const head:HTMLHeadElement = window.document.head || window.document.getElementsByTagName("head")[0];