Skip to content

Instantly share code, notes, and snippets.

View mdahlstrom's full-sized avatar

Mathias Dahlström mdahlstrom

View GitHub Profile
@mdahlstrom
mdahlstrom / dfu-component.vue
Created June 12, 2019 12:33
Vue.js component that uses the package dfu-js to update nrf 51/52 MCU via Web Bluetooth
<template lang="html">
<form v-on:submit.prevent>
<fieldset v-if="dfuIdle">
<input type="file" @change="processFile" />
<button @click="upload">Update Device</button>
</fieldset>
<fieldset v-if="dfuInProgress">
<progress class="progress is-primary" :value="dfuProgress" max="1.0">
</progress>
<button style="margin-top: 0.5rem;" @click="cancel">Cancel</button>
@mdahlstrom
mdahlstrom / vuex-action-tester.js
Created August 9, 2017 04:16
Chai based class for testing vuex actions. Based on the samples available at https://vuex.vuejs.org/en/testing.html but accepts functions instead of object to validate payload for dispatched actions and mutations.
import {expect} from 'chai'
export default class VuexActionTester {
constructor(action, payload, mutations, dispatches, done) {
this.action = action
this.payload = payload
this.state = {}
this.mutations = mutations
this.mutationsCount = 0
this.dispatchesCount = 0
@mdahlstrom
mdahlstrom / gist:3237633
Created August 2, 2012 14:56
Kinect WebSocket install OSX Lion / Mountain Lion install
1. install xcode
from the Mac App Store
2. Install Macports
https://distfiles.macports.org
3. Install libtool
sudo port install libtool
4. install libusb
First tired out the depth.js library to give the chrome and safari extensions a go. neither of them worked out of the box with my osx 10.7 setup. Reverted to use more modular approach
Starting out with the the following tutorial
http://tohmjudson.com/?p=30
The openni binaries mentioned in the tutorial above is abit hidden but can be found on the following url
http://www.openni.org/downloadfiles/opennimodules/openni-binaries/20-latest-unstable
Read up how people wired it up with processing
http://urbanhonking.com/ideasfordozens/2011/02/16/skeleton-tracking-with-kinect-and-processing/