Skip to content

Instantly share code, notes, and snippets.

Jumper Chen jumperchen

Block or report user

Report or block jumperchen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jumperchen
jumperchen / socket-cheatsheet.js
Created Dec 22, 2017 — forked from alexpchin/socket-cheatsheet.js
A quick cheatsheet for socket.io
View socket-cheatsheet.js
// sending to sender-client only
socket.emit('message', "this is a test");
// sending to all clients, include sender
io.emit('message', "this is a test");
// sending to all clients except sender
socket.broadcast.emit('message', "this is a test");
// sending to all clients in 'game' room(channel) except sender
@jumperchen
jumperchen / TestOKHttp.java
Created May 3, 2017
onClosing : 1001 reason
View TestOKHttp.java
import java.util.concurrent.TimeUnit;
import okio.ByteString;
public class TestOKHttp {
private static OkHttpClient client;
private static WebSocket ws;
private static boolean success = false;
@jumperchen
jumperchen / README.md
Created Apr 29, 2016 — forked from digulla/README.md
Make ZK play nice with Fediz SSO
View README.md
@jumperchen
jumperchen / Dockerfile
Created Dec 15, 2015
ZKSandbox's Dockerfile
View Dockerfile
FROM java:8-jdk
MAINTAINER Jumper Chen <jumperchen@potix.com>
ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
# Config to get to install git, maven, and tomcat7
RUN apt-get update && apt-get install -y --force-yes git maven tomcat7
VOLUME /zksandbox
# copy your zksandbox (depends on where the Dockerfile located) folder
@jumperchen
jumperchen / Book.java
Last active Nov 18, 2015
ZK MVVM with Spring MVC Example
View Book.java
public class Book {
private Set<Category> categories = new LinkedHashSet<Category>();
private String author;
private String name;
public Book() {}
public void setCategories(Set<Category> categories) {
this.categories = categories;
}
public Set<Category> getCategories() {
@jumperchen
jumperchen / Todo.java
Last active Nov 18, 2015
ZK Spring MVC Example
View Todo.java
public class Todo {
private String message;
private boolean done;
public Todo() {}
public Todo(String message) {
this.message = message;
}
@jumperchen
jumperchen / Serialization.java
Created May 29, 2015
Javassist with JDK 8 serialization issue
View Serialization.java
package issue;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
import java.lang.reflect.Method;
import javassist.util.proxy.MethodFilter;
@jumperchen
jumperchen / ForEachVM.java
Created May 6, 2015
ZK 8-RC Performance Testing
View ForEachVM.java
package org.zkoss.test;
import java.util.Collections;
import java.util.List;
public class ForEachVM {
private List<Integer> array = Collections.nCopies(30, 30);
public void setArray(List<Integer> array) {}
public List<Integer> getArray() {
return array;
@jumperchen
jumperchen / t.zul
Created Dec 4, 2012
Global Monitor
View t.zul
<script><![CDATA[
zk.afterMount(function () {
zk.Desktop._dt.firstChild.appendChild(new GlobalResizeMonitor());
});
GlobalResizeMonitor = zk.$extends(zk.Widget, {
bind_: function () {
this.$supers('bind_', arguments);
zWatch.listen({onSize: this});
},
unbind_: function () {
@jumperchen
jumperchen / ExampleTest.scala
Created Oct 7, 2011
an example of ZTL Scala test case
View ExampleTest.scala
@Tags(tags = "Example")
class ExampleTest extends ZTL4ScalaTestCase {
def testClick() = {
val zscript = {
<vbox>
Click "hello world", if you see the message change, it is ok.
<zscript><![CDATA[
public void doCreate(Event evt) {
evt.target.setValue(" hello,\\n world");
You can’t perform that action at this time.