Skip to content

Instantly share code, notes, and snippets.

@yongjunj
yongjunj / XMLEventReaderPatched.scala
Created July 24, 2015 04:51
XMLEventReaderPatched.scala with fixes for (1) XML parser thread hanging and (2) apostrophe in EvText
package com.comprehend.panacea.util
/**
* Created by yongjunj on 7/8/15.
*
* There seems to be a known issue with XMLEventReader hanging:
* 1. https://issues.scala-lang.org/browse/SI-3881
* 2. https://issues.scala-lang.org/browse/SI-4599
* 3. http://goo.gl/JL6BsR
*
@yongjunj
yongjunj / example.json
Created October 10, 2014 22:30
Line series that doesn't render on latest Chrome v38.0.2125.101
{
"scales": [
{
"name": "x-scale",
"range": "width",
"type": "ordinal",
"padding": 0.4,
"domain": {
"data": "table",
"field": "data.x"
@yongjunj
yongjunj / docker-run.yaml
Created August 6, 2014 16:19
docker-run role
- name: Running Veblen server Docker image
docker: docker_url={{ DOCKER_URL }} image="{{ DOCKER_IMAGE_NAME }}:{{ DOCKER_IMAGE_TAG }}" ports="{{ item.port }}" env="{{ item.env }}" volumes="{{ item.volumes }}" detach=true state=running
with_items: DOCKER_RUN_PARAMS
@yongjunj
yongjunj / docker-build.yml
Last active August 29, 2015 14:04
docker-build role
---
- name: Uploading docker build context
copy: src=docker/app/ dest="{{ DOCKER_BUILD_PATH }}" force=yes
- name: Building server Docker image
docker_image: docker_url={{ DOCKER_URL }} name={{ DOCKER_IMAGE_NAME }} tag={{ DOCKER_IMAGE_TAG }} path={{ DOCKER_BUILD_PATH }} state=build
---
- hosts: docker_host
user: root
serial: 1
pre_tasks:
- name: disable the server in haproxy
sudo: true
shell: echo "disable server some_haproxy_prefix_{{ item.port }}" | socat stdio /var/run/haproxy/admin.sock
delegate_to: "{{ HAPROXY_URL }}"
@yongjunj
yongjunj / stocks-legend-2-series-hack.json
Created July 19, 2014 19:39
Based on "stocks" example at http://trifacta.github.io/vega/editor/. Note the "legend-series-x" scale seems to be halved, and doubling the scale range values fixes the issue.
{
"width": 500,
"height": 200,
"data": [
{
"name": "stocks",
"url": "data/stocks.csv",
"format": {"type": "csv", "parse": {"price":"number", "date":"date"}},
"transform": [
{
@yongjunj
yongjunj / stocks-legend-2-series.json
Created July 19, 2014 19:38
Based on "stocks" example at http://trifacta.github.io/vega/editor/. Note the "legend-series-x" scale seems to be halved.
{
"width": 500,
"height": 200,
"data": [
{
"name": "stocks",
"url": "data/stocks.csv",
"format": {"type": "csv", "parse": {"price":"number", "date":"date"}},
"transform": [
{
{
"width": 500,
"height": 200,
"data": [
{
"name": "stocks",
"url": "data/stocks.csv",
"format": {"type": "csv", "parse": {"price":"number", "date":"date"}}
}
],