Skip to content

Instantly share code, notes, and snippets.

View abearxiong's full-sized avatar
💭
coding

熊潇 abearxiong

💭
coding
  • china
View GitHub Profile
// This example illustrates a Callback Property, a property whose
// value is lazily evaluated by a callback function.
// Use a CallbackProperty when your data can't be pre-computed
// or needs to be derived from other properties at runtime.
var viewer = new Cesium.Viewer("cesiumContainer");
viewer.clock.shouldAnimate = true;
var startLatitude = 35;
var startLongitude = -120;
var endLongitude;
@abearxiong
abearxiong / test
Last active January 10, 2023 09:17
[test lepton] test lepton #test
ttestset
@abearxiong
abearxiong / cresh.vue
Created December 21, 2022 09:19
vue实现气泡运动撞击效果,作者:https://blog.csdn.net/weixin_39150852?type=blog
<template>
<ul id="main">
<li v-for="(item, index) in circleData" :key="index" :class="{'active': item.is_latest_sign_user}">
<div>
<span>{{ item.nick_name }}</span>
<span>签到</span>
</div>
</li>
</ul>
</template>
@abearxiong
abearxiong / system-import-marked.js
Created November 2, 2022 09:54
system-import-markded
const main = async () => {
const libUrl = 'https://cdn.jsdelivr.net/npm/marked/marked.min.js';
const lib = await System.import(libUrl);
if(lib) {
const marked = lib.default;
const markdown = `# markddown`
app.innerHTML = marked.parse(markdown);
}
};
main();
@abearxiong
abearxiong / system-import-css.js
Last active November 2, 2022 09:38
system import css and import to root element.
const main = async () => {
const cssUrl = 'https://cdn.bootcdn.net/ajax/libs/tailwindcss/2.2.19/tailwind.min.css';
const lib = await System.import(cssUrl)
if(lib && lib.default) {
root.adoptedStyleSheets = [...root.adoptedStyleSheets, lib.default]
}
}
main();
@abearxiong
abearxiong / array.from.js
Last active May 13, 2022 07:13
es6 Array
// test Array.from
// 第一个参数为来源的值
// 第二个参数为映射转化函数(可选)
// 第三个为第二个参数提供this(可选)
let helper = {
diff: 1,
add(value) {
return value + this.diff;
}
@abearxiong
abearxiong / 前端工程化.md
Created May 9, 2022 17:06
关于前端工程化,开发提效的思考?

问题:随着项目变大,开发可能变得越来越复杂,例如运行或打包速度,有什么好的优化经历过好的方法?

想法

当前

未来一定是可视化编程的方向,前端变得无论多复杂,理应都应该是属于前端,意思就是仅仅只是展示页面的功能。
那么变大的过程,就属于开发的代码足够多,自然会有运行和打包速度的问题,那么直接解决方法就是分组件,分模块。

无论是开发代码还是运行代码,都应该是按需加载,缓存加载,空闲时间加载。

// ==UserScript==
// @name print juejin
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author abearxiong
// @match *://juejin.cn/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=juejin.cn
// @grant none
// ==/UserScript==
@abearxiong
abearxiong / delete_node_modules.py
Created May 5, 2022 13:34
删除node_modules的文件夹
import os
import shutil
# path可以根据具体情况设置
path = '/Users/xion/归档/km/web'
delete_list = []
def get_py(path):