Skip to content

Instantly share code, notes, and snippets.

@ExceptionsEnum
public enum CommonExceptions {
/*public static final*/ NOT_FOUND /* = new CommonExceptions() */ /*enum*/ ;
public RuntimeException exceptions;
private CommonExceptions() {
super();
}
private /*missing*/ CommonExceptions(Integer code, String message) {
@NWYLZW
NWYLZW / .cpp
Last active May 13, 2021 12:23
sample QThread
class testThread
: public QThread {
Q_OBJECT
public:
bool isLock = true;
void run() {
while (1) {
sleep(1);
@NWYLZW
NWYLZW / ali_pay_helper.py
Created October 26, 2021 10:15
AliPayHelper
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import json
from base64 import encodebytes
from datetime import datetime
from typing import Dict, Any
from urllib.parse import quote_plus
from Crypto.Hash import SHA256
from Crypto.PublicKey import RSA
@NWYLZW
NWYLZW / millionaire.py
Created October 30, 2021 16:54
百万富翁问题
import json, random, rsa
def int_to_bytes(i: int):
return i.to_bytes(i.bit_length() + 7, 'big')
def bytes_to_int(b: bytes):
return int.from_bytes(b, 'big')
if __name__ == '__main__':
@NWYLZW
NWYLZW / markTool.mjs
Created November 5, 2021 03:14
学校打卡
import axios from 'axios'
import * as qs from 'querystring'
import crypto from 'crypto'
import dayjs from 'dayjs'
import dotenv from '../dotenv.mjs'
/**
* @param {string} str
* @return {string}
@NWYLZW
NWYLZW / shims-vue-router.d.ts
Created November 7, 2021 07:58
shims for vue
import 'vue-router'
declare module 'vue-router' {
interface RouteMeta {
title: string
need?: {
groups?: string[]
}
icon?: NodeRequire,
activeIcon?: NodeRequire
@NWYLZW
NWYLZW / index.html
Created November 10, 2021 07:16
hack qqcord, add dark theme.
<!DOCTYPE html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<link rel="icon" href="app://./favicon.ico" />
<style>
div.icons {
z-index: 100000;
@NWYLZW
NWYLZW / selector-combinator-space-after.js
Last active November 22, 2021 09:54
Nest css in scss `selector-combinator-space-after`.
const { utils, createPlugin } = require('stylelint')
const
parseSelector = require('stylelint/lib/utils/parseSelector'),
whitespaceChecker = require('stylelint/lib/utils/whitespaceChecker'),
isStandardSyntaxRule = require('stylelint/lib/utils/isStandardSyntaxRule')
const ruleName = 'in/selector-combinator-space-after'
const messages = utils.ruleMessages(ruleName, {
expected: combinator => `Expected single space after "${ combinator }"`
})
@NWYLZW
NWYLZW / api.spec.ts
Created December 27, 2021 06:42
Rester
import MockAdapter from 'axios-mock-adapter'
import { AxiosInstance } from 'axios'
import { expect, use } from 'chai'
import cap from 'chai-as-promised'
import { Api, attachApi } from '../src/api'
use(cap)
describe('Api', function () {
@NWYLZW
NWYLZW / b.go
Last active August 15, 2022 05:05
type testA {}
func (*testA) funA() {
}