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
  • 11:07 (UTC -12:00)
View GitHub Profile
@voldikss
voldikss / redis.service
Created April 9, 2023 08:31 — forked from sshymko/redis.service
Redis service for systemd on Linux
View redis.service
[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
View introrx.md
View typescript-compiler-api.ts
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,
View typescript_decorator.ts
@classDecFactory()
class Student {
@propertyDecFactory()
name: string
@methodDecFactory()
run(@parameterDecFactory() arg: string) {
console.log(arg)
}
}
@voldikss
voldikss / asdf
Created September 3, 2021 11:18
asdf
@voldikss
voldikss / gh-check
Created January 22, 2021 05:35 — forked from lilydjwg/gh-check
gh-check: speed test to known GitHub IPs
View gh-check
#!/usr/bin/python3
import asyncio
import time
import socket
import argparse
import aiohttp
class MyConnector(aiohttp.TCPConnector):
View vim-useful-text-objects.adoc
@voldikss
voldikss / floaterm_nested_pic.vimrc
Created August 27, 2020 02:34
The config used to generate floaterm's nested-nvim demo
View floaterm_nested_pic.vimrc
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
View textobj.vim
" ============================================================================
" 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]
@voldikss
voldikss / effective_modern_cmake.md
Created February 29, 2020 13:49 — forked from mbinna/effective_modern_cmake.md
Effective Modern CMake
View effective_modern_cmake.md

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft