Skip to content

Instantly share code, notes, and snippets.

{
"components": [
{
"id": "glucose-component",
"period": {
"start_date": "2018-07-11T00:00:00Z",
"end_date": "2018-08-10T23:59:59Z"
},
"links": [
{
{
"components": [
{
"id": "glucose-component",
"period": {
"start_date": "2018-07-11T00:00:00Z",
"end_date": "2018-08-10T23:59:59Z"
},
"links": [
{
@zxqx
zxqx / chart.json
Last active October 3, 2018 19:26
{
"components": [
{
"id": "weight-component",
"period": {
"start_date": "2018-08-04T20:36:00Z",
"end_date": "2018-09-02T23:59:59Z"
},
"links": [
{
@zxqx
zxqx / App.js
Last active March 12, 2016 06:42
import React, { Component } from 'react';
import { connect } from 'react-redux';
import Header from '../../components/header';
import { attemptUserAuthentication, logoutAndRedirect } from '../../actions/auth';
import { getUserInfo, sendConfirmationEmail } from '../../actions/users';
@connect(state => ({
auth: state.auth,
users: state.users
}))
@zxqx
zxqx / compile-less.js
Created February 25, 2016 18:58
Compile a collection of stringified LESS styles directly in the browser
/**
* Compile a collection of stringified LESS styles directly in the browser
* @param {string} less
*
* e.g. compileLess('body { div { border: 2px solid aqua; } }');
*/
function compileLess(less)
{
var style = document.createElement('style');
style.type = 'text/less';
@zxqx
zxqx / unit-test.js
Last active April 8, 2016 21:44
unit-test.js
// ------------------------------------------
// square-number.js
// ------------------------------------------
module.exports = squareNumber;
function squareNumber(number)
{
return number * number;
}
@zxqx
zxqx / example.html
Last active February 23, 2016 03:26
example.html
<!doctype html>
<html>
<head>
</head>
<body>
Some bullshit content
<script src="./your-script.js"></script>
</body>
</html>
@zxqx
zxqx / drake.js
Created January 4, 2016 04:01
Using prompt
var prompt = require('prompt');
prompt.start();
prompt.get(['diameter', 'angle'], function (err, result) {
console.log('Diameter: ' + result.diameter);
console.log('Angle: ' + result.angle);
});
var path = require('path');
var Promise = require('bluebird');
var uniq = require('uniq');
var fs = Promise.promisifyAll(require('fs'));
var SERVER_APP_PATH = 'src/server/app/publish';
var PREAMBLE_PATH = path.join(SERVER_APP_PATH, 'preamble.js');
var CAPSULE_BUILD_PATH = path.join(SERVER_APP_PATH, 'capsule.build.js');
var SAMPLE_CAPSULE_PATH = path.join(SERVER_APP_PATH, 'sample-capsule.json');