翻山

技术
技术

读源码系列:koajs

koajs是一个基于node的web框架,通过 async/await(es7) 函数,以优雅的方式实现了一套编写web服务程序的方法。 在解读koajs之前,先了解下node原生处理web的方式。 const http = require('http') const server = http.createServer((req , res) => { res.write('hello world') res.end() }) server.listen(8080) http.createServer 需要…

16/06/2020 0条评论 793点热度 0人点赞 admin 阅读全文
技术

JS: 树形结构转表格显示

典型的树形结构转表格显示时,需要考虑行列合并的问题。 原理:先将树形结构转成平面的二维度数组,然后借助每个元素的层级关系判断行列合并。 示例。 代码 const convert = (data) => { // 扁平化 const flatten = (d , ret = [] , parentLv = [] , parentData = []) => { d.forEach((i , idx) => { let currentLv = [...parentLv,idx] let currentD…

09/10/2019 0条评论 803点热度 1人点赞 admin 阅读全文
技术

Ubuntu14.04安装最新版Nginx

Ubuntu14.04默认的Nginx是十分老旧的1.4.6,无法支持stream。 打开/etc/apt/sources.list添加源 deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx 执行 wget -q -O- http://nginx.org/keys/nginx_signing.key | apt-key a…

22/04/2019 0条评论 728点热度 0人点赞 admin 阅读全文
技术

Kimsufi 自动下单脚本

先前写过ks库存监控脚本,但是效果较差,很对人反映得到通知时已经没库存了。 于是新写个监控带下单的脚本。 项目地址 https://github.com/reruin/ServerStockCheck 使用方法 1.确保安装油猴,点击下方链接安装脚本 https://github.com/reruin/ServerStockCheck/raw/master/ssc.user.js 2.找一个能下单的地址,先登录一次。   3. 去往指定型号的ks下单页,可以从 https://www.kimsufi.co…

25/08/2018 0条评论 667点热度 0人点赞 admin 阅读全文
技术

[ShareList]GoogleDrive/OneDrive在线挂载

ShareList是一个简易网盘挂载工具,用于挂载GoogleDrive 、 OneDrive。 项目地址 github: https://github.com/reruin/sharelist

20/04/2018 0条评论 1692点热度 23人点赞 admin 阅读全文
技术

JS螺旋线

这是前几天实现的一段JS输出螺旋线的算法。特此记录 ~~ 演示 function printSpiral(s , d , st) { var rect = new Array(s * s).fill(0); var r = [ [ 1, 0, 1], [ 0, 1, 2], [-1, 0, 3], [ 0, -1, 0] ]; var stack = [] var px = function(x, y) { return (x < 0 || y < 0 || x > s - 1 || y >…

26/12/2017 0条评论 317点热度 0人点赞 admin 阅读全文
技术

ubuntu下使用deb包安装chrome

系统 ubuntu 16.04 wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb apt-get install libgconf2-4 libnss3-ld libxssl dpkg -i google-chrome-stable_current_amd64.deb root下必须以 –no-sandbox 模式运行,否则会报一下错误: root without no-sandbox is not supp…

10/12/2017 0条评论 287点热度 0人点赞 admin 阅读全文
技术

Kimsufi 库存检测工具

写这个的契机,是去年搭建NAS时正好刚上 kimsufi 放出特价独服,本着是个轮子就想造一下的想法,就有了这个库存监测工具。 目前支持 kimsufi 和 wholesaleinternet,后期还会增加新的商家监测。 项目地址: https://github.com/reruin/ServerStockCheck Changelog 2018-08-20 + 添加消息通知 * 修改ks的监测逻辑 * 新的样式 2017-03-12 + 添加对wsi的支持

02/05/2017 0条评论 306点热度 0人点赞 admin 阅读全文
技术

ngrok 服务端一键安装脚本

练手作品。 适用于 CentOS / Debian / Ubuntu 安装 wget --no-check-certificate -O ngrok.sh https://raw.githubusercontent.com/reruin/ngrok/master/ngrok.sh && chmod +x ngrok.sh && bash ngrok.sh install 卸载 wget --no-check-certificate -O ngrok.sh https://raw.gi…

13/04/2017 0条评论 515点热度 1人点赞 admin 阅读全文

COPYRIGHT © 2016 ~ present 翻山. ALL RIGHTS RESERVED.

THEME KRATOS MADE BY VTROIS