Skip to content

Instantly share code, notes, and snippets.

View wd's full-sized avatar

Dong Wang wd

View GitHub Profile
@wd
wd / config.json
Last active August 19, 2023 22:23
路由器梅林固件上面使用 v2ray 的方案
{
"log": {
"loglevel": "none"
},
"inbound": {
"port": 23456,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
@wd
wd / config.json
Last active April 17, 2023 08:38
基于 3.8.6 以上 ss 版本的方案
{
"log": {
"loglevel": "none"
},
"inbound": {
"port": 23456,
"listen": "127.0.0.1",
"protocol": "socks",
"settings": {
"udp": true
@wd
wd / exec.js
Created December 12, 2021 08:28
Create exec graph for OpenWrt
'use strict';
'require baseclass';
return baseclass.extend({
title: _('Exec'),
rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
// host: Tux
// plugin: exec
// plugin_instance: wireguard
// dtype: null
var wireguard_last_handshake_time = {
@wd
wd / squirrel.custom.yaml
Created January 5, 2019 01:32
Squirre themes
patch:
style:
color_scheme: mojave_dark # 方案命名,不能有空格
horizontal: true
inline_preedit: true # 单行显示,false双行显示
candidate_format: "%c\u2005%@" # 用 1/6 em 空格 U+2005 来控制编号 %c 和候选词 %@ 前后的空间。
corner_radius: 5 # 候选条圆角
hilited_corner_radius: 3 # 高亮圆角
border_height: 6 # 窗口边界高度,大于圆角半径才生效
border_width: 6 # 窗口边界宽度,大于圆角半径才生效
@wd
wd / test_click_module_bug.py
Last active April 14, 2020 05:08
Could you find where is the bug?
from collections import defaultdict
import click
@click.group()
@click.pass_context
def cli(ctx):
print('cli init')
@cli.group()
@wd
wd / gist:940470617b09ba84fd431ae1b9e72e4d
Created October 30, 2019 10:48
试试能不能用一个帖子把作文这件事讲明白
http://www.newsmth.net/bbsrecon.php?id=23116
一. 写作,和学校的作文
写作是个很大的概念。把自己的想法用文字记录下来,就可以称为写作。之前版上有个帖子说写作是表达,这很对,但不完整。写作的另一个特点是目的性。东西写出来,或者自娱自省,或者说服他人,或者传达情感,这些都是目的,要考虑受众的预期和感受。目的不明确或者不准确,就很难实现合格的写作。
学校的作业作文和应试作文有目的吗?有:要得分,得高分。不过,这个层面太肤浅了。进一步的问题是:怎么才能得高分?除了作者(学生)本人的表达欲望之外,还要考虑到试题要求、打分机制和给分点、判卷老师的偏好,等等。应试作文不是单纯的写好文章,好文章未必是成功的应试作文,好的应试作文未必算得上是篇好文章。这非常分裂,却是无奈的现实,学生要学会 live with it。
二. 试题要求、打分机制和给分点、判卷老师的偏好
@wd
wd / a_start.py
Created November 24, 2018 06:58
#!/usr/bin/python
import sys
import random
RED = '\033[31m'
GREEN = '\033[32m'
GRAY = '\033[35m'
NC = '\033[0m'
@wd
wd / skin_port_py_26.ini
Last active February 24, 2018 04:24
ios 百度输入法默认皮肤上面增加符号,同时去掉了逗号句号那个按钮,然后扩大了空格的长度,上滑输入的是半角符号,下滑输入的是全角的
[INPUT]
[CAND]
VIEW_RECT=0,0,1242,40
LAYOUT_NAME=cand
TYPE=2
[PANEL]
BACK_STYLE=147
SIZE=1242,648
@wd
wd / App.js
Last active October 21, 2017 00:17
React-native react-redux with react-navigation StackNavigator single page demo
/**
* 一个简单的 RN 应用,有 2 个页面,使用了 react-navigation 的 StackNavigator 来做界面管理
* 为了说明如何使用 redux,以及如何让 redux 和 StackNavigator 配合
* 为了容易理解,把所有内容都放到了一个页面里面,实际开发的时候不要这么做
* 参考:
* https://github.com/jackielii/simplest-redux-example
* http://www.ruanyifeng.com/blog/2016/09/redux_tutorial_part_three_react-redux.html
*/
import React, { Component } from 'react';