Skip to content

Instantly share code, notes, and snippets.

View CodecWang's full-sized avatar
🎯
Focusing

Arthur Wang CodecWang

🎯
Focusing
View GitHub Profile
@CodecWang
CodecWang / bing-gist-integration.py
Created November 8, 2023 05:40
Code from bing chat
import cv2
# Load the image
img = cv2.imread('image.jpg')
# Split the image into its three channels (blue, green, and red)
b_channel, g_channel, r_channel = cv2.split(img)
# Display each channel onto our screen for visualization purposes
cv2.imshow('Blue Channel', b_channel)
@CodecWang
CodecWang / bing-gist-integration.md
Last active October 20, 2023 05:31
Code from bing chat

Here is a Python code snippet that retrieves parameters from a URL:

from urllib.parse import urlparse, parse_qs

def get_params(url):
    parsed_url = urlparse(url)
    captured_value = parse_qs(parsed_url.query)['some_key'][0]
    return captured_value

This code uses the urlparse and parse_qs functions from the urllib.parse module to extract the value of the query parameters from a URL. The get_params function takes a URL as input and returns the value of the some_key parameter. You can modify this function to extract other parameters as well.

@CodecWang
CodecWang / setup-wsl-for-frontend.sh
Created April 18, 2023 12:37
Quickly setup a WSL-Ubuntu frontend development environment.
#################################
# 快速初始化 WSL-Ubuntu 前端开发环境
#################################
# 更新 package
sudo apt update -y && sudo apt upgrade -y
# 安装 zsh
sudo apt install zsh -y
@CodecWang
CodecWang / result.d.ts
Last active November 11, 2021 08:59
[ZenJS] AST 数据结构
interface ParamNode {
name: string;
type: TypeNode;
}
interface TypeNode {
kind: string;
rawName: string;
}
@CodecWang
CodecWang / custom-theme.less
Last active August 3, 2021 08:19
[daily] 代码片段
// 主题色
@primary-color: #1890ff;
@primary-5: #1890ff;
@primary-1: rgba(24; 144; 255; 0.05);
// 通用 item hover 背景色
@item-hover-bg: rgba(26; 102; 255; 0.03);
// 文本主色
@text-color: #081333;
@CodecWang
CodecWang / .prettierrc.js
Created July 24, 2021 04:43
[prettier] Perttier配置实践 #Perttier
module.exports = {
// 行宽
printWidth: 120,
// 指定每个缩进的空格数量
tabWidth: 2,
// 行的缩进是否使用 Tab 而不是空格
useTabs: false,
// 语句行尾是否添加分号
semi: true,
// 字符串是否使用单引号而不是双引号
@CodecWang
CodecWang / node-list.js
Last active July 24, 2021 04:42
[js-data-structure] JS数据结构 #JavaScript
/**
* Node definition
*/
class Node {
constructor(data) {
this.data = data;
this.next = null;
}
}