Skip to content

Instantly share code, notes, and snippets.

View dgageot's full-sized avatar

David Gageot dgageot

View GitHub Profile
package main
import (
"archive/tar"
"fmt"
"io"
"log"
"os"
tartar "github.com/vbatts/tar-split/archive/tar"
// 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
public Process startProxy()
{
try
{
String proxyPath = Path.Combine(Paths.ResourcesPath,"whale.exe");
return Process.Start(proxyPath);
} catch(System.ComponentModel.Win32Exception we)
{
Logger.LogError(we.Message);
return null;

Keybase proof

I hereby claim:

  • I am dgageot on github.
  • I am dgageot (https://keybase.io/dgageot) on keybase.
  • I have a public key whose fingerprint is 65D5 6C85 C3E2 D178 8B74 748A BD07 EF32 CB52 2D64

To claim this, I am signing this object:

@dgageot
dgageot / fluentHttp.groovy
Created June 9, 2015 16:40
fluent-http Groovy Style
import net.codestory.http.WebServer
@Grab(group='net.code-story', module='http', version='2.98')
def startWebServer() {
new WebServer()
.configure {routes -> routes.anyGet {ctx -> "Hello"}}
.start()
}
startWebServer()
@dgageot
dgageot / FindParametersTypes.java
Created August 19, 2014 10:05
Find Lambda parameter types with serialization. Works only on serializable lambda
package avaj.lang.invoke;
import java.io.*;
import java.lang.invoke.SerializedLambda;
import static java.nio.charset.StandardCharsets.ISO_8859_1;
public class FindParametersTypes {
public static void main(String[] args) throws Exception {
System.out.println(getMethodSignature((String s) -> s));
@dgageot
dgageot / FindParametersTypes.java
Created August 19, 2014 10:03
Find Lambda parameter types
package test;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.function.Function;
import static java.util.stream.Stream.of;
public class FindParametersTypes {
@dgageot
dgageot / Events.java
Created May 23, 2014 14:56
Server-sent events in fluent-http
new WebServer(routes -> routes
.get("/events", () -> Stream.iterate(0, (a) -> a + 1)))
.start(9090);
@dgageot
dgageot / MyModule.java
Created May 2, 2014 10:24
Guice cycle proxies
@Override
protected void configure() {
// ... insert the bindings here
binder().disableCircularProxies();
}