Skip to content

Instantly share code, notes, and snippets.

View rhalff's full-sized avatar

Robbert Halff rhalff

  • Robbert Halff
  • Netherlands
View GitHub Profile
@rhalff
rhalff / cordova-plugin-guide.md
Created June 9, 2017 11:37 — forked from mlynch/cordova-plugin-guide.md
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction

@rhalff
rhalff / a2dp_sink_ubuntu_linux.md
Created January 28, 2017 20:01 — forked from joergschiller/a2dp_sink_ubuntu_linux.md
A2DP Sink on Ubuntu Linux with bluez (streaming bluetooth stereo audio from smartphone to pc)

Howto Enable and Use A2DP Sink on Ubuntu Linux with Bluez

  1. Add Enable=Source to /etc/bluetooth/audio.conf right after [General].

  2. Find address in form XX:XX:XX:XX:XX:XX of phone with hcitool scan.

  3. Pair and trust smartphone with sudo bluez-simple-agent hci0 XX:XX:XX:XX:XX:XX and sudo bluez-test-device trusted XX:XX:XX:XX:XX:XX yes.

  4. Create loopback in pulseaudio connection bluetooth a2dp source with alsa sink:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>ForOf</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<script src="./suite.js"></script>
</head>
<body>
<h1>Open the console to view the results</h1>
@rhalff
rhalff / gist:98526476c6bde0cae9b5db927e01248c
Created November 30, 2016 13:34
Plugin 0 specified in babel-preset-es2015 provided an invalid property of _c
rm -rf node_modules
npm prune
npm cache clear
npm cache clean
npm i
@rhalff
rhalff / gh-pages-deploy.md
Created September 25, 2016 14:14 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@rhalff
rhalff / fire.js
Created September 17, 2016 23:17
<dom-module id="the-graph">
<link rel="import" type="css" href="../themes/the-graph-dark.css">
<link rel="import" type="css" href="../themes/the-graph-light.css">
<template>
<div id="svgcontainer"></div>
</template>
<script type="text/javascript" src="../dist/static/app.bundle.js"></script>
<script>
(function () {
'use strict';
<dom-module id="the-graph-editor">
<template>
<the-graph id="graph" name="{{ graph.properties.name }}" graph="{{nofloGraph}}" menus="{{menus}}" width="{{width}}" height="{{height}}" pan="{{pan}}" scale="{{scale}}" autolayout="{{autolayout}}" theme="{{theme}}" selectednodes="{{selectedNodes}}" errornodes="{{errorNodes}}" selectededges="{{selectedEdges}}" animatededges="{{animatedEdges}}" displayselectiongroup="{{displaySelectionGroup}}" forceselection="{{forceSelection}}" getmenudef="{{getMenuDef}}">
</the-graph>
</template>
<script>
(function () {
'use strict';
Polymer({
is: 'the-graph-editor',
(function(){
"use strict";
Array.prototype.clean = function() {
for (var i = 0; i < this.length; i++) {
if (this[i] == null) {
this.splice(i, 1);
i--;
}
}
var compile = browserify();
compile.require('chix-flow', {
//basedir: '',
expose: 'chix-flow'
});
// hacking tha systems, externalized hack:
// https://gist.github.com/rhalff/11017968#file-gistfile1-js-L6
var stream = through();
@rhalff
rhalff / Redis Events
Created August 17, 2016 12:31
Listen for all redis events from cli
http://redis.io/topics/notifications
$ redis-cli config set notify-keyspace-events KEA
$ redis-cli --csv psubscribe '__key*__:*'
Reading messages... (press Ctrl-C to quit)
"psubscribe","__key*__:*",1