Skip to content

Instantly share code, notes, and snippets.

View mengwangk's full-sized avatar

Meng Wang mengwangk

View GitHub Profile
@mengwangk
mengwangk / config.eskip
Created July 26, 2024 15:52
Skipper Configuration
myapp: *
-> setResponseHeader("Content-Security-Policy","default-src 'none'; script-src 'self' 'unsafe-inline' cdn.jsdelivr.net; connect-src 'self'; img-src 'self' 'unsafe-inline' fastapi.tiangolo.com; style-src 'self' 'unsafe-inline' cdn.jsdelivr.net; base-uri 'self'; form-action 'self'")
-> setResponseHeader("Strict-Transport-Security","max-age=31536000; preload")
-> setResponseHeader("X-Content-Type-Options","nosniff")
-> setResponseHeader("Referrer-Policy","same-origin")
-> "http://frontend:5173";
@mengwangk
mengwangk / docker-compose.yml
Last active July 26, 2024 16:03
Docker Compose File
version: "3.9"
services:
base:
environment:
HTTP_PROXY:
HTTPS_PROXY:
env_file:
- .env
postgres:
extends: base
@mengwangk
mengwangk / .env
Last active July 26, 2024 16:02
Environment file
# PostgreSQL
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgres
# pgadmin
PGADMIN_DEFAULT_EMAIL=pgadmin@localhost.com
PGADMIN_DEFAULT_PASSWORD=pgadmin
# Database info
DB_HOST=postgres
@mengwangk
mengwangk / options.lua
Last active November 3, 2023 06:06
Neovim Plugins and Configuration Recipes | 5
local function update_lead()
local lcs = vim.opt_local.listchars:get()
local tab = vim.fn.str2list(lcs.tab)
local space = vim.fn.str2list(lcs.multispace or lcs.space)
local lead = { tab[1] }
for i = 1, vim.bo.tabstop - 1 do
lead[#lead + 1] = space[i % #space + 1]
end
vim.opt_local.listchars:append { leadmultispace = vim.fn.list2str(lead) }
@mengwangk
mengwangk / pickers.lua
Last active September 30, 2023 14:00
Neovim Plugins and Configuration Recipes | 3
M.actions = transform_mod {
set_extension = function(prompt_bufnr)
local current_input = action_state.get_current_line()
vim.ui.input({ prompt = "*." }, function(input)
if input == nil then
return
end
live_grep_filters.extension = input
actions.close(prompt_bufnr)
@mengwangk
mengwangk / utils.lua
Last active September 23, 2023 13:47
Neovim Plugins and Configuration Recipes | 3
local M = {}
local function default_on_open(term)
vim.cmd "startinsert"
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", { noremap = true, silent = true })
end
function M.open_term(cmd, opts)
opts = opts or {}
opts.size = opts.size or vim.o.columns * 0.5
@mengwangk
mengwangk / init.lua
Last active August 10, 2023 12:57
Modern Neovim - User Interface
local opts = {
defaults = {
mappings = mappings,
vimgrep_arguments = {
"rg",
"-L",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
{
"echasnovski/mini.clue",
cond = function()
return require("config").keymenu.mini_clue
end,
event = "VeryLazy",
opts = function()
local map_leader = function(suffix, rhs, desc)
vim.keymap.set({ "n", "x" }, "<Leader>" .. suffix, rhs, { desc = desc })
end
@mengwangk
mengwangk / languages.toml
Last active August 5, 2023 12:45
Helix - Languages
[language-server.pyright]
command = "pyright-langserver"
args = ["--stdio"]
config = { settings = { python = { analysis = { autoImportCompletions = true, typeCheckingMode = "off", autoSearchPaths = true, useLibraryCodeForTypes = true, diagnosticMode = "openFilesOnly" } } } }
[language-server.ruff-lsp]
command = "ruff-lsp"
[[language]]
name = "python"
@mengwangk
mengwangk / config.toml
Last active July 29, 2023 08:30
Helix - config.toml
theme = "everforest_dark"
[editor]
# Show currently open buffers, only when more than one exists.
bufferline = "multiple"
# Highlight all lines with a cursor
cursorline = true
# Use relative line numbers
line-number = "relative"
# Show a ruler at column 80 and 120