Skip to content

Instantly share code, notes, and snippets.

View sdeleuze's full-sized avatar

Sébastien Deleuze sdeleuze

View GitHub Profile
@sdeleuze
sdeleuze / kotlin-frontend.md
Last active October 25, 2022 14:50
My call for Kotlin as a major frontend language

My call for Kotlin as a major frontend language

I try to push for quite a long time for first class support for WebAssembly in Kotlin because I really believe that frontend development is a domain where Kotlin can be as strong as in mobile, and because this is something that would also help to increase even more the adoption on server-side.

I truly appreciate all the work already done by Kotlin/JS and Kotlin/Native teams. The dead code elimination tool and the initial WebAssembly support in Kotlin/Native are important steps in the right direction. But I believe that Kotlin needs now to make frontend a real priority to take it to the next level.

Need for a consistent and unified web frontend strategy

The first point I would like to raise is that what Kotlin needs IMO is a consistent strategy about web frontend wich includes both Javascript and WebAssembly related efforts. I can u

@sdeleuze
sdeleuze / keybase.md
Created July 18, 2018 20:15
keybase.md

Keybase proof

I hereby claim:

  • I am sdeleuze on github.
  • I am sdeleuze (https://keybase.io/sdeleuze) on keybase.
  • I have a public key ASBnYH1FZBqEFVtRTUE9cmsL6xifx7TJ1qfR2NAbp3tzZAo

To claim this, I am signing this object:

@sdeleuze
sdeleuze / gist:55e002d9e2a91990b591f650f18d348c
Created July 3, 2018 07:37
Spring Fu minimal Netty webapp compilation as native image with GraalVM 1.0 RC3
error: Detected a started Thread in the image heap. This is not supported. The object was reached from a static initializer. All static class initialization is done during native image construction, thus a static initializer cannot contain code that captures state dependent on the build machine. Write your own initialization methods and call them explicitly from your main entry point.
Detailed message:
Error: Detected a started Thread in the image heap. This is not supported. The object was reached from a static initializer. All static class initialization is done during native image construction, thus a static initializer cannot contain code that captures state dependent on the build machine. Write your own initialization methods and call them explicitly from your main entry point.
Trace: object io.netty.util.internal.ObjectCleaner$AutomaticCleanerReference
object java.util.concurrent.ConcurrentHashMap$Node
object java.util.concurrent.ConcurrentHashMap$Node[]
object java.util.concurrent.ConcurrentHashMap
@sdeleuze
sdeleuze / rs.java
Last active February 8, 2016 12:06
Reactive Streams interfaces
public interface Publisher<T> {
void subscribe(Subscriber<? super T> s);
}
public interface Subscriber<T> {
void onSubscribe(Subscription s);
void onNext(T t);
void onError(Throwable t);
void onComplete();
}
public interface Subscription {
// IE
if(typeof(window.console) === 'undefined') {
window.console = {};
window.console.log = window.console.error = window.console.info = window.console.debug = window.console.warn = window.console.trace = window.console.dir = window.console.dirxml = window.console.group = window.console.groupEnd = window.console.time = window.console.timeEnd = window.console.assert = window.console.profile = function() {};
}
var console = window.console;
// IE8 & 9
var methods = ['log', 'debug', 'info','warn','error','assert','dir','clear','profile','profileEnd'];
//########################### registry.map() ###############################
@Configuration
@EnableWebMvc
public class WebConfig extends WebMvcConfigurerAdapter {
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(...);
}
@sdeleuze
sdeleuze / CompletableToListenableFutureAdapter.java
Created May 21, 2015 09:39
CompletableToListenableFutureAdapter
/*
* Copyright 2002-2015 the original author or authors.
*
* 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
@sdeleuze
sdeleuze / gist:a522ef9096b03737e553
Last active August 29, 2015 14:14
Smart same origin check
public abstract class AbstractSockJsService implements SockJsService {
// ...
private static final String XFRAME_OPTIONS_HEADER = "X-Frame-Options";
// ...
/**
* Check the {@code Origin} header value and eventually call {@link #addCorsHeaders(ServerHttpRequest, ServerHttpResponse, HttpMethod...)}.
/*
* Copyright 2012-2014 the original author or authors.
*
* 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
Blend tests
(3/4)
1
PASS
Blend tests values.
2
FAIL
Blend tests stringify. Expected: throws an instance of specified type Actual: <Closure: () => dynamic> Which: threw NoSuchMethodError:<No constructor 'AssertionError' declared in class 'AssertionError'. NoSuchMethodError : method not found: 'AssertionError' Receiver: Type: class 'AssertionError' Arguments: [...]>