Skip to content

Instantly share code, notes, and snippets.

BEGIN MESSAGE.
qPWzasbOcRuUgUg A8PTpKt6Vgud1aM 7bxKpG3bJXNzDWi jvFdV523JECg5Yp
rZRIH9h9FIceV9H 1l4bCXRSjsBTCKq 6Xr2MZHgg4Sa4jc ULOIwDFvPPto5SL
nodbaoE5jT2Oi0z e9wjyGla09T9Sa2 VGRZLxEcLY01ACm QPpgcRMNa0d4Yqz
WMlZx8B15qxDTyB vxPCIQZLJVgaD33 YbXne2IP.
END MESSAGE.
{
"title": "Microsoft Sculpt Mouse",
"rules": [
{
"description": "Mission Control, expose and launchpad with side button",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "delete_or_backspace",
@jorgeyp
jorgeyp / 0_reuse_code.js
Created January 5, 2017 10:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jorgeyp
jorgeyp / 1-dimensional.json
Last active October 18, 2016 14:12
PROTEUS format
[
{ "x": 34 },
{ "x": 35 },
{ "x": 36 },
{ "x": 35 },
]
@jorgeyp
jorgeyp / strategy_barchart.js
Created September 5, 2016 12:10
Proteus barchart D3 v4 minus transitions
class SvgBarchartStrategy extends SvgChart {
constructor(chartContext) {
super(chartContext);
//Create range function
this.xAxisName = 'x';
this.yAxisName = 'y';
// this.x = d3.scale.ordinal().rangeRoundBands([0, this.width], 0.1);
this.x = d3.scaleBand()
.rangeRound([0, this.width])
@jorgeyp
jorgeyp / proteus-messages.md
Last active August 2, 2016 07:39
Proteus connector messages

Proteus connector messages

Rationale

We want the developers to be able to create charts from the backend code. In order to achieve that, Proteus-backend may send WebSocket messages containing a chart identifier along its data, visualisation type and aditional information like a label. With this design, the Proteus-charts library should be able to create new charts on demand for new charts from the backend.

Implementation

On the client side, the developer may set a container div where the library will create additional div containers for each new chart requested from the server.

Data format

The following is a proposed data format for the connector messages:

@jorgeyp
jorgeyp / jsdoc-example.js
Created July 6, 2016 10:55
JSDoc example
/**
* Add new data to the current graph. If it is empty, this creates a new one.
* @param {Object} datum - data to be rendered
*/
keepDrawing(datum) {
super.keepDrawing(datum, 'replace');
}
@jorgeyp
jorgeyp / alt1.json
Last active June 21, 2016 12:26
Sunburst data formats
[
{
"id":"1",
"children":[
{
"id":"2",
"value":"30"
},
{
"id":"3",
@jorgeyp
jorgeyp / mysql_conn
Last active August 29, 2015 14:14
MySQL Java connection example
String SQL_DRV = "com.mysql.jdbc.Driver";
String SQL_URL = "jdbc:mysql://"
+ host + ":" + port
+ "/" + dbName
+ "?user=" + user
+ "&password=" + password;
Class.forName(SQL_DRV);
con = DriverManager.getConnection(SQL_URL);