code screenshot beautify plugin & 代码截图美化插件
2024-10-19 21:33:00
code screenshot beautify plugin & 代码截图美化插件
代码截图美化
codesnap
微信分享代码截图
https://github.com/kufii/CodeSnap
demo
"use strict";
/**
*
* @author xgqfrms
* @license MIT
* @copyright xgqfrms
* @created 2020-10-01
* @modified
*
* @description
* @difficulty Easy Medium Hard
* @complexity O(n)
* @augments
* @example
* @link
* @solutions
*
* @best_solutions
*
*/
const log = console.log;
const Koa = require('koa');
const app = new Koa();
const port = 3000;
// logger
app.use(async (ctx, next) => {
log(` 1`)
await next();
log(` 2`)
const rt = ctx.response.get('X-Response-Time');
log(`${ctx.method} ${ctx.url} - ${rt}`);
});
// x-response-time
app.use(async (ctx, next) => {
const start = Date.now();
log(` 3`)
await next();
log(` 4`)
const ms = Date.now() - start;
ctx.set('X-Response-Time', `${ms}ms`);
});
// response
app.use(async ctx => {
log(` 5`)
ctx.body = 'Hello World';
});
app.listen(port);
/*
Promise 先后顺序, async/await
1
3
5
4
2
GET /?q=xgqfrms - 2ms
1
3
5
4
2
GET /favicon.ico - 0ms
*/
自定义配置
Carbon
Carbon | Create and share beautiful images of your source code
https://github.com/carbon-app/carbon
refs
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
最新文章
- 必杀技———SQL基础整理系列(一)
- Oracle行转列(使用pivot函数)
- Oracle 查询今天、昨日、本周、本月和本季度的所有记录
- 函数式编程语言LISP,python,haskell,clojure
- Java初学(七)
- [改善Java代码]正确使用String,StringBuffer,StringBuilder
- 深入理解ReentrantLock
- 图片翻页效果引出的animate.css,很好玩,多动动吧~
- UESTC-888-Absurdistan Roads(kruskal+floyd)
- wpf中xps文档合并功能实现
- php面向对象1
- 遍历Map集合:java.util.Map.Entry、KeySet两种方式
- 如何导入css和js?
- gcc如何生成预编译头文件(.gch)
- Java NIO 概览
- IOT高性能服务器实现之路
- 【翻译】WhatsApp 加密概述(技术白皮书)
- python3 pip 安装Scrapy在win10 安装报错error: Microsoft Visual C++ 14.0 is required. Get it with ";Microsoft Visual C++ Build Tools";: http://landinghub.visualstudio.com/visual-cpp-build-tools
- c#随机生成英文名
- 小程序 input 键盘弹出时样式遮盖问题