Skip to content

Instantly share code, notes, and snippets.

View voldikss's full-sized avatar
💭
I may be slow to respond.

voldikss

💭
I may be slow to respond.
  • Shanghai
  • 19:09 (UTC -12:00)
View GitHub Profile
@classDecFactory()
class Student {
@propertyDecFactory()
name: string
@methodDecFactory()
run(@parameterDecFactory() arg: string) {
console.log(arg)
}
}
import * as ts from 'typescript'
function makeFactorialFunction() {
const functionName = ts.factory.createIdentifier('factorial')
const paramName = ts.factory.createIdentifier('n')
const parameter = ts.factory.createParameterDeclaration(
undefined,
undefined,
undefined,
paramName,
@voldikss
voldikss / introrx.md
Created June 20, 2022 09:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@voldikss
voldikss / redis.service
Created April 9, 2023 08:31 — forked from sshymko/redis.service
Redis service for systemd on Linux
[Unit]
Description=Redis persistent key-value storage
After=network.target
[Service]
Type=notify
ExecStart=/usr/bin/redis-server /etc/redis.conf --supervised systemd --daemonize no
ExecStop=/usr/bin/redis-cli -p 6379 shutdown
ExecReload=/bin/kill -USR2 $MAINPID
Restart=always

ESLint的缓存机制及其在CI中的应用

背景

ESLint是一个前端、Node领域中流行的代码规范检查工具,使用起来很方便。

之前为了强制推行代码规范,我在CI任务中加入了ESLint检查。保障了规范的同时,也引入了痛点:CI的时长延长了2~3分钟左右。因为现在开发的工程体量比较大,ESLint会占用很多的内存、CPU资源,且运行时间较长。

@voldikss
voldikss / docker-registry-mirrors.md
Created June 8, 2024 13:54 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+