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
  • 22:00 (UTC -12:00)
View GitHub Profile

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

背景

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

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

@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
@voldikss
voldikss / introrx.md
Created June 20, 2022 09:17 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
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,
@classDecFactory()
class Student {
@propertyDecFactory()
name: string
@methodDecFactory()
run(@parameterDecFactory() arg: string) {
console.log(arg)
}
}
@voldikss
voldikss / asdf
Created September 3, 2021 11:18
asdf
asdf
@voldikss
voldikss / gh-check
Created January 22, 2021 05:35 — forked from lilydjwg/gh-check
gh-check: speed test to known GitHub IPs
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):

Some useful custom text objects for vim

Collection of my custom text objects I use quite often.

97975602 6e90ee00 1dda 11eb 9286 6894300457e3

Numbers

Put it into your .vimrc:

@voldikss
voldikss / floaterm_nested_pic.vimrc
Created August 27, 2020 02:34
The config used to generate floaterm's nested-nvim demo
set statusline=
set showtabline=0
set laststatus=0
set ruler!
set noshowmode
set noshowcmd
let g:floaterm_width = 0.8
let g:floaterm_height = 0.8
let g:floaterm_title = ''
augroup cmdline
" ============================================================================
" FileName: textobj.vim
" Author: voldikss <dyzplus@gmail.com>
" GitHub: https://github.com/voldikss
" ============================================================================
function! lib#textobj#(pattern) abort
let pos = getpos('.')
let lnum = pos[1]
let cnum = pos[2]