Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥
Working hard on Vaccination Campaign in France and Germany

David Gageot dgageot

🔥
Working hard on Vaccination Campaign in France and Germany
View GitHub Profile
@dgageot
dgageot / zengular.coffee
Last active Aug 29, 2015
AngularJs from Scratch - In CoffeeScript
View zengular.coffee
# Scope
#
class Scope
constructor: ->
@$$watchers = []
$watch: (watcherFn, listener, byValue = false) ->
@$$watchers.push
fn: watcherFn
listener: listener
View developers.json
[
{
"email": "david@devoxx.io",
"prenom": "David",
"job": "Développeur Java/Web",
"ville": "Paris, France",
"description": "Bonjour, je suis développeur indépendant. Ma passion ? L'écriture de logiciels pointus mais simples.",
"tags": [
"Java", "Web", "Javascript", "Agile", "Formation", "Git", "Coaching", "Test"
],
View doc.md

Application Web Moderne en Java

The CodeStory Way

by David Gageot & Jean-Laurent de Morlhon

Devoxx Hand's on Labs

Louis Armstrong CD

13:30 - 16:30

@dgageot
dgageot / MergedIterator.java
Last active Dec 5, 2020
Merged Iterator. Uses Guava
View MergedIterator.java
import java.util.Collections;
import java.util.Comparator;
import java.util.Iterator;
import java.util.NoSuchElementException;
import com.google.common.collect.Iterators;
import com.google.common.collect.PeekingIterator;
public class MergedIterator<T> implements Iterator<T> {
private final Comparator<? super T> comparator;
View AssertJ.java
List<Item> items_1 = new ItemsProvider().getItems();
List<Item> items_2 = new ItemsProvider().getItems();
assertThat(items_1).usingFieldByFieldElementComparator().containsExactlyElementsOf(items_2);
View Function.java
public interface Function<T, R> {
R apply(T t);
static Function<?, String> toStringFunction() {
return value -> value.toString();
}
static <E> Function<E, E> identity() {
return value -> value;
}
View cost.litcoffee

Google Compute Engine Cost Calculation

This code computes the current hourly and monthly cost of a project on Google Compute Engine. It uses this pricing page as the reference.

Read raw json files

Read all the files produced by gcutil. Then turn each file content into json.

@dgageot
dgageot / create.sh
Last active Aug 29, 2015
Simpler scripts
View create.sh
#!/bin/bash
PROJECT=code-story-blog
COUNT=5
NAMES=$(seq -f "helloworld-%02g" 1 $COUNT)
echo -e "\nCREATE SNAPSHOT"
gcutil --project=$PROJECT addsnapshot helloworld --zone=europe-west1-a --source_disk=master --cache_flag_values
echo -e "\nCREATE DISKS"
View MongoJongoFongoTest.java
import org.jongo.Jongo;
import org.jongo.MongoCollection;
import org.junit.Test;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.github.fakemongo.Fongo;
import com.mongodb.DB;
import static org.assertj.core.api.Assertions.assertThat;
View app.coffee
angular.module 'myapp', []
.controller 'DemoController', class
constructor: (@$location) ->
@field = 'Field'
method: ->
'Method'
methodWithParam: (param) ->