Skip to content

Instantly share code, notes, and snippets.

View Tuch's full-sized avatar

Alex Afonin Tuch

View GitHub Profile
import { stringify } from 'qs';
import { isObject } from 'lodash/fp';
import { nanoid } from 'nanoid';
const url = '/a/track-envent';
const CID_KEY = '_acid';
export const createAnalytics = ({ apiOrigin }) => {
let context = {};
@Tuch
Tuch / index.js
Last active August 29, 2015 14:22
requirebin sketch
var dom = require('virtual-dom');
var fromHTML = require('virtual-html');
var html = '<svg namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg" height="160" width="160"> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-bg" cx="80" cy="80" r="78" stroke="#f2f2f2" stroke-width="4" fill="none" ></circle> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-progress" cx="80" cy="80" r="78" stroke="#f9c033" stroke-width="4" fill="none" stroke-dashoffset="228.92" stroke-dasharray="503, 999"></circle> </svg>'
var svgTags = {
'CIRCLE': true,
'CLIPPATH': true,
'DEFS': true,
'ELLIPSE': true,
@Tuch
Tuch / index.js
Last active August 29, 2015 14:22
requirebin sketch
var dom = require('virtual-dom');
var fromHTML = require('virtual-html');
var toHTML = require('vdom-to-html');
var html = '<svg namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg" height="160" width="160"> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-bg" cx="80" cy="80" r="78" stroke="#f2f2f2" stroke-width="4" fill="none" ></circle> <circle namespace = "http://www.w3.org/2000/svg" class="stats-aside__svg-progress" cx="80" cy="80" r="78" stroke="#f9c033" stroke-width="4" fill="none" stroke-dashoffset="228.92" stroke-dasharray="503, 999"></circle> </svg>'
var vsvg = fromHTML(html);
var node = dom.create(vsvg);
document.body.appendChild(node)