Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@wvengen
wvengen / README.md
Last active January 16, 2020 13:49
d3.chart.sankey (product demo)

d3.chart.sankey: Reusable D3 Sankey diagram using d3.Chart.

This diagram shows how the ingredients may contribute to the total sustainability of a chocolate bar through different issues.

@wvengen
wvengen / README.md
Last active January 19, 2017 01:17
d3.chart.sankey (energy demo)
@wvengen
wvengen / README.md
Last active November 10, 2018 22:36
d3.chart.sankey (interactive demo)
@wvengen
wvengen / README.md
Last active October 5, 2015 10:14
Running a VST with Carla in a VM using netjack

Testing Carla's VST bridge in a VM with netjack

Install Ubuntu Server 15.04 in VirtualBox and enable OpenSSH. Then:

sudo apt-get install -yy apt-transport-https software-properties-common wget
wget https://launchpad.net/~kxstudio-debian/+archive/kxstudio/+files/kxstudio-repos_9.2.0~kxstudio1_all.deb
sudo dpkg -i kxstudio-*.deb

sudo apt-get update

@wvengen
wvengen / README.md
Last active March 25, 2024 07:53
Ruby memory analysis over time

Finding a Ruby memory leak using a time analysis

When developing a program in Ruby, you may sometimes encounter a memory leak. For a while now, Ruby has a facility to gather information about what objects are laying around: ObjectSpace.

There are several approaches one can take to debug a leak. This discusses a time-based approach, where a full memory dump is generated every, say, 5 minutes, during a time that the memory leak is showing up. Afterwards, one can look at all the objects, and find out which ones are staying around, causing the

@wvengen
wvengen / README.md
Last active January 25, 2016 12:00
d3.chart UMD chart

Basic example showing how to make a chart based on d3.chart using the new and shiny UMD interface. This is currently being discussed in #117, and not ready for use. It will be! present from d3.chart 0.3.0 onwards.

  1. git clone https://gist.github.com/5789e5b2a295156ea48e.git && cd 5789e5b2a295156ea48e.git
  2. npm install
  3. webpack index.js build.js
  4. open index.html
  5. see a basic circle graph
@wvengen
wvengen / Modal.android.js
Last active January 13, 2016 10:19
Basic Modal for react-native on Android
// Basic Android-implementation of Modal
//
// based on https://github.com/niftylettuce/react-native-loading-spinner-overlay
import React, {StyleSheet, View} from 'react-native';
const Portal = require('react-native/Libraries/Portal/Portal.js');
export default React.createClass({
@wvengen
wvengen / README.md
Last active September 17, 2021 12:23
Basic redux-api example
@wvengen
wvengen / README.md
Last active October 4, 2016 17:44
Raspberry Pi HiFi audio options
@wvengen
wvengen / README.md
Last active October 10, 2016 08:05
Using redux-api with batch requests

redux-api provides an easy and flexible way to interface with REST APIs in Redux (e.g. when building a React app). It works pretty well when there you know beforehand what API calls you're going to make, and define them in its configuration object.

But when you want to make multiple calls to the same endpoint, and don't know beforehand how many, you're a bit out of luck. In my case, I had a product listing where each product had a category and a score. In a summary overview, I wanted to show a histogram of the scores for each category. That means: first a request to the categories endpoint, and then for each of the categories, a request to the histogram endpoint.

This is an example of how to do that.

screenshot