Skip to content

Instantly share code, notes, and snippets.

View markni's full-sized avatar
🏠
Working from home

Mark Ni markni

🏠
Working from home
View GitHub Profile
(window.webpackJsonp=window.webpackJsonp||[]).push([[1],[function(t,e,n){var r=n(6),o=n(23),i=n(15),a=n(16),s=n(24),u=function(t,e,n){var c,f,l,p,d=t&u.F,h=t&u.G,v=t&u.S,m=t&u.P,y=t&u.B,g=h?r:v?r[e]||(r[e]={}):(r[e]||{}).prototype,b=h?o:o[e]||(o[e]={}),w=b.prototype||(b.prototype={});for(c in h&&(n=e),n)l=((f=!d&&g&&void 0!==g[c])?g:n)[c],p=y&&f?s(l,r):m&&"function"==typeof l?s(Function.call,l):l,g&&a(g,c,l,t&u.U),b[c]!=l&&i(b,c,p),m&&w[c]!=l&&(w[c]=l)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,s){var u,c="function"==typeof t?t.options:t;if(e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),a?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},c._ssrRegister=u):o&&(
@markni
markni / agenda-debug.js
Created June 22, 2018 02:34
Processing speed of large batch of agenda.now() jobs drops dramatically as time goes by
const Agenda = require(`agenda`);
const mongoose = require(`mongoose`);
mongoose.connect(process.env.MONGO);
const agenda = new Agenda({
maxConcurrency: 1,
db: {
address: process.env.MONGO,
@markni
markni / webpack.config.js
Created June 3, 2018 23:55
Vue-cli 3 webpack resolve alias config
module.exports = {
resolve: {
alias: {
"@": require("path").resolve(__dirname, "src")
}
}
};
var path = require('path');
var Jimp = require("jimp");
var gd = require('node-gd');
var gm = require('gm').subClass({imageMagick: true});
const width = 800;
const height = 100;
const fontSize = 64;
const text = 'LABEL 1232-235-123 GD';

Apple Watch Radial Chart (sort of)

Tried recreate apple watch's new radial chart with d3. Turns out to be surprisingly hard. D3 natively does not support round corner on arcs, not to mention that conical gradient involves lots of hacks as well (which I did not implement).

Used a modified version of d3 by mbostock, which implemented a round corner for arcs in d3, see more details on this pull request on github (which have never made into production):

d3/d3#1132

A Pen by xna2 on CodePen.

Infinite Loading Animation

A 26 frames loading animation using css sprites(single png) and css3 keyframe animation (written in SASS).

A Pen by Ruocaled on CodePen.

License.

@markni
markni / CSS3-SAO-flyout-menu-.markdown
Last active December 31, 2015 04:19
A Pen by Ruocaled.