Skip to content

Instantly share code, notes, and snippets.

View Madoshakalaka's full-sized avatar
😋

Siyuan Yan Madoshakalaka

😋
  • Cardiff University
  • Cardiff, Unitied Kingdom
View GitHub Profile
@Madoshakalaka
Madoshakalaka / project-specific-lsp.md
Last active November 28, 2023 19:46
setting up project-specific feature flags for lsp in neovim (and also html and css completion in rust)

disclaimer: the completion setup is for vsnip but I think you can easily adapt it to other completion engines.

so the nice thing about my setup is that it only sets up html suggestion for specific projects using the power of excr files (.nvim.lua in this case). (it also works for CSS suggestions if you are into css-in-rust stuff)

First you want to have this in your lua config to enable projet-specific config files.

vim.o.exrc = true

from typing import List
def quick_sort_find_n_th_largest(numbers: List[float], n: int) -> float:
pivot = numbers[0]
left = []
right = []
@Madoshakalaka
Madoshakalaka / singleton.py
Created August 24, 2019 07:10
pythonic singleton class
class ClassName:
_instance = None
def __init__(self, arg1, arg2, arg3):
if ClassName._instance is None:
# do initialization here
ClassName._instance = self
def __new__(cls, **kwargs):
if cls._instance is None:
import os
import sys
import select
import termios
import tty
import pty
from subprocess import Popen
command = 'python'
# command = 'docker run -it --rm centos /bin/bash'.split()