This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * r: circle -> r, ellipse -> rx, ry | |
| */ | |
| export const getCenterPoint = (x, y, r) => (r.rx ? { | |
| x: x + r.rx, | |
| y: y + r.ry, | |
| rx: r.rx, | |
| ry: r.ry, | |
| } : { | |
| x: x + r, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // pug | |
| div.menu | |
| ul | |
| each v in [1,2,3,4,5,6,7,8] | |
| li | |
| a( href='#' )= v | |
| // css | |
| @mixin circle-layout($radius, $dot-radius, $num) { | |
| $deg: 360deg / $num; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;(() => { | |
| const mergeText = (str, text) => { | |
| if (str === '') { | |
| return text; | |
| } | |
| if (!text || text === ' ' || str === text) { | |
| return str; | |
| } | |
| str = str.replace(/\s+/g, ' ') | |
| .replace(/\t|\r|\n/g, ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getUUID() { | |
| const canvas = document.createElement('canvas'); | |
| const ctx = canvas.getContext('2d'); | |
| ctx.fillStyle = '#ff0000'; | |
| ctx.fillRect(0,0,8,10); | |
| const b64 = canvas.toDataURL().replace('data:image/png;base64,', ''); | |
| const bin = window.atob(b64); | |
| return bin2hex(bin.slice(-16, -12)); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const babel = require('@babel/core'); | |
| const t = require('@babel/types'); | |
| const sampleCode = `\ | |
| import {uniq, extend, flatten, cloneDeep } from "lodash"; | |
| export default function Test() { | |
| return ( | |
| <Sky.Card> | |
| Test | |
| <Wind.Button type="primary" loading>{intl('sas.baseline.inDetection')}</Wind.Button> |
OlderNewer