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 all the files produced by gcutil
. Then turn each file content into json.
import static java.nio.charset.StandardCharsets.*; | |
import static javax.script.ScriptContext.*; | |
import java.io.*; | |
import net.codestory.http.io.*; | |
import javax.script.*; | |
public class CoffeeToJs { |
angular.module 'myapp', [] | |
.controller 'DemoController', class | |
constructor: (@$location) -> | |
@field = 'Field' | |
method: -> | |
'Method' | |
methodWithParam: (param) -> |
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; |
#!/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" |
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 all the files produced by gcutil
. Then turn each file content into json.
List<Item> items_1 = new ItemsProvider().getItems(); | |
List<Item> items_2 = new ItemsProvider().getItems(); | |
assertThat(items_1).usingFieldByFieldElementComparator().containsExactlyElementsOf(items_2); |
[ | |
{ | |
"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" | |
], |
# Scope | |
# | |
class Scope | |
constructor: -> | |
@$$watchers = [] | |
$watch: (watcherFn, listener, byValue = false) -> | |
@$$watchers.push | |
fn: watcherFn | |
listener: listener |
new WebServer(routes -> routes | |
.get("/events", () -> Stream.iterate(0, (a) -> a + 1))) | |
.start(9090); |