Skip to content

Instantly share code, notes, and snippets.

View kiddouk's full-sized avatar

sebastien requiem kiddouk

  • copenhagen
View GitHub Profile
@kiddouk
kiddouk / nodejs-tcp-example.js
Last active November 2, 2017 13:12 — forked from tedmiston/nodejs-tcp-example.js
Node.js TCP client and server example
/*
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp
server, but for some reason omit a client connecting to it. I added an
example at the bottom.
Save the following server in example.js:
*/
var net = require('net');
@kiddouk
kiddouk / MockResponseInterceptor.java
Created April 13, 2017 12:13 — forked from mbunyard/MockResponseInterceptor.java
OkHttp3 interceptor which provides a mock response from local resource file.
package com.rogerthat.network.util;
import android.content.Context;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import okhttp3.Interceptor;
@kiddouk
kiddouk / MockResponseInterceptor.java
Created April 13, 2017 12:13 — forked from mbunyard/MockResponseInterceptor.java
OkHttp3 interceptor which provides a mock response from local resource file.
package com.rogerthat.network.util;
import android.content.Context;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLConnection;
import okhttp3.Interceptor;