Skip to content

Instantly share code, notes, and snippets.

@Kunkgg
Kunkgg / gist:07f869431f61efef357b7af1fc03e60d
Created July 27, 2024 15:11
vscode settings for pythonpath
{
"terminal.integrated.env.windows": {
"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}"
},
"terminal.integrated.env.linux": {
"PYTHONPATH": "${workspaceFolder}${pathSeparator}${env:PYTHONPATH}"
}
}
@Kunkgg
Kunkgg / try_vxe_app.vue
Created May 28, 2023 16:40
try_vxe_app
<template>
<div id="app">
<!-- <nav>
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</nav>
<router-view /> -->
<div>
<vxe-toolbar>
<template #buttons>
@Kunkgg
Kunkgg / global.code-snippet
Last active February 19, 2023 14:06
VScode snippets
{
// * Place your global snippets here.
// * docs: https://code.visualstudio.com/docs/editor/userdefinedsnippets#_snippet-scope
// region pre-define variables
// * The following variables can be used:
// TM_SELECTED_TEXT The currently selected text or the empty string
// TM_CURRENT_LINE The contents of the current line
@Kunkgg
Kunkgg / how_to_sphinx.md
Last active February 19, 2023 12:21
How to Sphinx

requirements

pip install sphinx

pip install sphinx-rtd-theme
# https://sphinx-themes.org/#themes
@Kunkgg
Kunkgg / Update git fork with tags.sh
Created November 5, 2022 12:03 — forked from Saissaken/Update git fork with tags.sh
Update git fork with tags
# Repo: someuser/myframework
# Fork: superteam/myframework
# Track:
git clone https://github.com/superteam/myframework.git
cd myframework
git remote add upstream https://github.com/someuser/myframework.git
# Update:
git fetch upstream
@Kunkgg
Kunkgg / vue-cli-django.md
Last active June 25, 2022 14:41 — forked from lsapan/vue-cli-django.md
Using Vue CLI to start a Vue frontend for use with a Django backend

Using Vue CLI to start a Vue frontend for use with a Django backend

Note: This guide has been updated for use with @vue/cli version 4! Please make sure you're using the latest version of @vue/cli.

When it comes to starting new Vue projects, you can't really beat Vue CLI. The Vue team has done a phenomenal job of making an easy-to-use tool for getting started with reasonable defaults. If you're using Django though, you may not have the easiest time getting its static system and webpack to play well together.

A good chunk of this is applicable to any webpack-compiled frontend and Django, but we'll focus specifically on the steps involved with Vue CLI.

As a quick heads up: this tutorial assumes you're creating your Vue project in a folder named frontend inside of your Django project folder. If you want it named something else, or want it in a different folder, just update the paths accordingly.

@Kunkgg
Kunkgg / clean-up-arch-linux.md
Created January 7, 2022 03:23 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@Kunkgg
Kunkgg / docker-compose-secrets-example.yml
Created December 27, 2021 12:04
Use Secrets in Compose
version: "3.9"
services:
db:
image: mysql:latest
volumes:
- db_data:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD_FILE: /run/secrets/db_root_password
MYSQL_DATABASE: wordpress
@Kunkgg
Kunkgg / sample.ldif
Created December 27, 2021 11:30
LDAP sample ldif file
dn: cn=developer,dc=example,dc=org
changetype: add
objectclass: inetOrgPerson
cn: developer
givenname: developer
sn: Developer
displayname: Developer User
mail: [email protected]
userpassword: developer_pass
@Kunkgg
Kunkgg / python_debug.md
Created December 27, 2021 11:27
python debug
  • 在源代码中设置断点
    • python 3.7 版本开始 breakpoint()
    • python 3.7 版本以前
      • import pdb; pdb.set_trace()
      • import ipdb; ipdb.set_trace()
  • 通过设置环境变量将 ipdb 设置为默认 debugger
    export PYTHONBREAKPOINT=ipdb.set_trace
    
  • IPython interactive mode alias in .pdbrc