Skip to content

Instantly share code, notes, and snippets.

wvengen wvengen

  • Amsterdam, NL
Block or report user

Report or block wvengen

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
@wvengen
wvengen / get-publitas.sh
Created Oct 11, 2018
Generate PDF from Publitas folder URL
View get-publitas.sh
#!/bin/sh
#
# Generates PDF from Publitas images (online folder service)
# Stores generated PDF and JSON (which may contains links).
#
# Requirements:
# - wget https://www.gnu.org/software/wget/
# - jq https://stedolan.github.io/jq/
# - imagemagick https://www.imagemagick.org/
#
@wvengen
wvengen / parse_xml_streaming.rb
Last active Apr 18, 2018
Parsing an XML stream from an HTTP endpoint in Ruby.
View parse_xml_streaming.rb
#!/usr/bin/env ruby
#
# Example of parsing a remote XML stream.
#
# Fetches data from an HTTP endpoint, and processes it bit by bit, without
# loading the whole file into memory.
#
# This example shows recent articles from the W3C blog feed.
#
require 'nokogiri'
@wvengen
wvengen / NOTES.md
Last active May 18, 2019
Freedrum on Linux
View NOTES.md

Freedrum on Linux

The recently released Freedrum has no official Linux support. But, fortunately, it uses standard Bluetooth LE MIDI. It doesn't seem to work out of the box, yet (on Ubuntu 17.04, most probably Ubuntu 18.04 will support it directly).

Bluez 5.46

One really needs bluez 5.46 or higher. On Ubuntu, these are packaged in artful proposed (amd64). Unfortunately, MIDI support is not enabled in this build (Ubuntu bug #1713017).

So you'll need to download the sources, install dependencies plus libasound2-dev, build and install resulting debs. You may need to add --enable-midi to debian/rules. Like this:

@wvengen
wvengen / update-freevpn.sh
Last active Apr 28, 2019
Update on-demand PPTP configuration for free VPNs
View update-freevpn.sh
#!/bin/sh
#
# Update freevpn.se pptp configuration
#
# Since the password changes now and then, it's useful to update it automatically.
# Make sure you've installed lynx. Tested on Debian.
#
URL=https://www.freevpn.se/accounts/
PEERNAME=freevpn.se
@wvengen
wvengen / gen_wpa_sup.py
Created Nov 25, 2016
wifi export for network-manager
View gen_wpa_sup.py
#!/usr/bin/env python
#
# Export network-manager WiFi connection details to a wpa-supplicant
# file. This can be saved to an Android device, so you have all your
# laptop's WiFi connections on your phone right away (root required).
#
# python gen_wpa_sup.py >foo
# adb push foo /sdcard/foo
# adb shell
# su -c 'cat /sdcard/foo >>/data/misc/wifi/wpa_supplicant.conf'
@wvengen
wvengen / README.md
Last active Oct 10, 2016
Using redux-api with batch requests
View README.md

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

@wvengen
wvengen / README.md
Last active Oct 4, 2016
Raspberry Pi HiFi audio options
View README.md
@wvengen
wvengen / README.md
Last active Feb 8, 2019
Basic redux-api example
View README.md
@wvengen
wvengen / Modal.android.js
Last active Jan 13, 2016
Basic Modal for react-native on Android
View Modal.android.js
// 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 Jan 25, 2016
d3.chart UMD chart
View README.md

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
You can’t perform that action at this time.