Skip to content

Instantly share code, notes, and snippets.

View chunghe's full-sized avatar

chunghe chunghe

  • cnyes.com
  • Taipei
View GitHub Profile
/** @jsx React.DOM */
var React = require("react");
class HelloWorld {
getInitialState() {
return {
name: null
};
}
@chunghe
chunghe / gist:3b85c6b858608dbbffdb
Created August 17, 2015 05:34
example json for rawgit teset
{"hello": "world"}
const parse = require('svg-path-parser');
const d = 'M198.314 131.725h-54.766c-1.458 0-1.988-1.32-1.148-2.51l16.032-21.349c.84-1.188 2.385-1.408 3.445-.352l3.136 3.125c1.06 1.057 2.65.969 3.577-.176l7.553-9.156c.927-1.144 2.385-1.056 3.224.132l20.096 27.777c.883 1.188.353 2.509-1.149 2.509zm-2.87-26.456c-3.136 0-5.654-2.553-5.654-5.634A5.627 5.627 0 0 1 195.443 94c3.136 0 5.654 2.553 5.654 5.635.044 3.08-2.518 5.634-5.654 5.634z';
const paths = parse(d);
const result = paths.map( path => {
switch (path.code.toLowerCase()) {
case 'm':
return `${path.code}${path.x} ${path.y}`;
case 'l':