Skip to content

Instantly share code, notes, and snippets.

Emiel Mols EmielM

Block or report user

Report or block EmielM

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
EmielM / rollup.config.js
Created Jul 27, 2017
react-native rollup bundle attempt
View rollup.config.js
import fs from 'fs';
import path from 'path';
import babel from 'rollup-plugin-babel';
import commonjs from 'rollup-plugin-commonjs';
import nodeResolve from 'rollup-plugin-node-resolve';
import typescript from 'rollup-plugin-typescript';
import replace from 'rollup-plugin-replace';
function findVersion(file, extensions) {
for (let e of extensions) {
View semi-anonymous-chat.diff
diff --git a/ b/
index 37b7239..a5eb7b9 100644
--- a/
+++ b/
@@ -49,7 +49,10 @@ exports.render = !->
Dom.div !->
Dom.cls 'chat-info'
- Dom.text tr("Anonymous coward")
+ if userId = msg.get('userId')
EmielM / uiwebview-tweaks.m
Created May 8, 2014
UIWebview enhancement hacks
View uiwebview-tweaks.m
// Continuously changing GIST of UIWebView 'tweaks' I use. Might be useful to others,
// hope Google finds this. Some of these already passed Review, but one never knows ;).
// Happy coding!
- (void)ScrollView_setContentOffset:(CGPoint)offset {
// Prevent superfluous scrolling animations (eg when toggling keyboard) by completely disabling scrolling. We achieve scrolling through inner scroll views (overflowing html elements).
- (id)WebBrowserView_inputAccessoryView {
// Make the keyboard accessory view (next/prev,submit buttons) optional, it really takes up to much screen estate in a normal app.
View gist:1901791
struct ZmqWaiter {
zmq::socket_t sleep_socket_;
ZmqWaiter(zmq::context_t& ctx) : sleep_socket_(ctx, ZMQ_PUSH) {}
// Waits for either
// (a) msecs milliseconds to pass
// (b) global zmq_ctx to be teared down
inline bool Sleep(unsigned long msecs) {
try {
zmq::pollitem_t pollitem;
EmielM / loading.html
Created Sep 18, 2011
Unintrusive img loading indicator
View loading.html
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0" />
@-webkit-keyframes spin {from {
-webkit-transform: rotate(0deg)
to {
-webkit-transform: rotate(360deg)
class Protocol
constructor: ->
# ..same as previous snippet
@recvCbs.stack = [0] # pointer stack
recv: (n, cb) ->
# insert callback at pointer on stack
@recvCbs.splice(@recvCbs.stack[@recvCbs.stack.length-1], 0, {n: n, cb: cb})
class Protocol
constructor: ->
@recvCbs = []
@recvBuffer = new ByteBuffer
@socket = new Socket
@socket.onData = @onData.bind(this)
send: (buf) -> @socket.write(buf)
recv: (n, cb) -> @recvCbs.push({n: n, cb: cb})
View traceroute
traceroute to (, 64 hops max, 52 byte packets
1 router ( 2.792 ms 1.361 ms 1.546 ms
2 ( 1.875 ms 3.482 ms 1.883 ms
3 ( 4.877 ms 5.007 ms 4.980 ms
4 ( 4.779 ms 6.927 ms 4.989 ms
5 ( 5.395 ms 5.186 ms 5.370 ms
6 ( 5.415 ms 5.237 ms 5.551 ms
7 ( 7.747 ms 7.859 ms 7.658 ms
8 ( 7.618 ms 7.545 ms 7.802 ms
EmielM / schema.xml
Created Dec 16, 2010
Mondrian cube schema
View schema.xml
<Schema name="TestSchema">
<Cube name="TestCube" caption="Caption" cache="false" enabled="true">
<Table name="SolarData"></Table>
<Dimension type="StandardDimension" name="Time">
<Hierarchy hasAll="true">
<Level name="Year" column="time" type="String" uniqueMembers="true">
<KeyExpression><SQL dialect="generic"><![CDATA[extract(year from time)]]></SQL></KeyExpression>
<NameExpression><SQL dialect="generic"><![CDATA[extract(year from time)]]></SQL></NameExpression>
<Level name="Month" column="time" type="String" uniqueMembers="false">
View compile-error
$ i686-apple-darwin9-g++ -c -o test.o -I/home/emiel/mac/include 2>&1 | head -n30
In file included from /home/emiel/mac/include/boost/asio/socket_base.hpp:26,
from /home/emiel/mac/include/boost/asio/basic_socket.hpp:26,
from /home/emiel/mac/include/boost/asio/basic_datagram_socket.hpp:25,
from /home/emiel/mac/include/boost/asio.hpp:20,
/home/emiel/mac/include/boost/asio/detail/socket_option.hpp:78: error: using template type parameter 'Protocol' after 'struct'
/home/emiel/mac/include/boost/asio/detail/socket_option.hpp:85: error: using template type parameter 'Protocol' after 'struct'
/home/emiel/mac/include/boost/asio/detail/socket_option.hpp:92: error: using template type parameter 'Protocol' after 'struct'
/home/emiel/mac/include/boost/asio/detail/socket_option.hpp:99: error: using template type parameter 'Protocol' after 'struct'
You can’t perform that action at this time.