Skip to content

Instantly share code, notes, and snippets.

@imzhi
imzhi / paint
Created October 9, 2024 09:09 — forked from robopuff/paint
Draw image in terminal (True Color) with PHP
#!/usr/bin/env php
<?php
define('VERSION', '1.0.24');
define('DEFAULT_PIXEL', "\xE2\x96\x84");
define('RC', "\e[0m");
define('RCNL', RC . PHP_EOL);
define('CURRENT_FILE', array_shift($argv));
error_reporting(0);
@imzhi
imzhi / vue_mall_godd_spec_test.html
Last active November 28, 2023 05:13
vue 实现电商的规格选中效果
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>电商规格</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lodash.min.js"></script>
<style>
@imzhi
imzhi / 1.js
Created November 13, 2023 08:25
vue 网页模拟输入并点击!
const event = document.createEvent('HTMLEvents')
event.initEvent('input', true, true)
event.eventType = 'message'
setInterval(() => {
const aainput = document.querySelector("#app > div > div.content > div.message-box > div.footer > input")
aainput.value = new Date().toGMTString()
aainput.dispatchEvent(event)
const btn = document.querySelector("#app > div > div.content > div.message-box > div.footer > button:nth-child(3)")
@imzhi
imzhi / .editorconfig
Created December 1, 2021 06:24
.editorconfig
# Top-most EditorConfig file
root = true
[*]
indent_style = space
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
function UnicodeChr() {
return '00A4,00A7,00A8,00B0,00B1,00B7,00D7,00E0,00E1,00E8,00E9,00EA,00EC,00ED,00F2,00F3,00F7,00F9,00FA,00FC,0101,0113,011B,012B,014D,016B,01CE,01D0,01D2,01D4,01D6,01D8,01DA,01DC,02C7,02C9,0391,0392,0393,0394,0395,0396,0397,0398,0399,039A,039B,039C,039D,039E,039F,03A0,03A1,03A3,03A4,03A5,03A6,03A7,03A8,03A9,03B1,03B2,03B3,03B4,03B5,03B6,03B7,03B8,03B9,03BA,03BB,03BC,03BD,03BE,03BF,03C0,03C1,03C3,03C4,03C5,03C6,03C7,03C8,03C9,0401,0410,0411,0412,0413,0414,0415,0416,0417,0418,0419,041A,041B,041C,041D,041E,041F,0420,0421,0422,0423,0424,0425,0426,0427,0428,0429,042A,042B,042C,042D,042E,042F,0430,0431,0432,0433,0434,0435,0436,0437,0438,0439,043A,043B,043C,043D,043E,043F,0440,0441,0442,0443,0444,0445,0446,0447,0448,0449,044A,044B,044C,044D,044E,044F,0451,2014,2016,2018,2019,201C,201D,2026,2030,2032,2033,203B,2103,2116,2160,2161,2162,2163,2164,2165,2166,2167,2168,2169,216A,216B,2190,2191,2192,2193,2208,220F,2211,221A,221D,221E,2220,2225,2227,2228,2229,222A,222B,222E,2234,2235,2236,2237,223
@imzhi
imzhi / ShortCutList.txt
Last active April 21, 2021 01:13
ALTRun ShortCutList.txt
F112 | |Computer |我的电脑 |::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
F0 | |Explorer |资源管理器 |explorer.exe /e,::{20D04FE0-3AEA-1069-A2D8-08002B30309D}
F0 | |MyDocument |我的文档 |explorer.exe
F8 | |ie |IE浏览器 |iexplore.exe
F7 | |notepad |记事本 |notepad
F0 | |mspaint |画图 |mspaint
F6 |No_Encoding |cmd |Dos窗口 |cmd /k %p
F6 | |Calc |计算器 |calc
F0 | |Desktop |显示桌面 |@.\WinCtl.exe MinAll
F0 | |msconfig
@imzhi
imzhi / self.css
Created February 27, 2021 09:12
tampermonkey 自定义 css
.CodeMirror pre {
font-family: Consolas, 'Courier New', monospace;
}
@imzhi
imzhi / html_match_content.js
Created January 15, 2021 02:29
检查当前html内容是否匹配内容
// 在chrome console输入以下语句
tstr = document.body.innerText
tpat = /换声|换脸|换头|假脸|模拟脸|声音模拟|模拟声|假声|语音处理|声音伪造|肤色|发型|虚拟人|模拟人|虚拟角色|模拟角色|虚拟女|模拟女|虚拟男|模拟男/g
tstr.match(tpat)
@imzhi
imzhi / laravel_print_sql.php
Created January 15, 2021 02:21
laravel 打印当前 SQL 语句
<?php
$list = Application::with('_user', '_category')
->where(function ($query) {
$query->whereHas('_currentRepostory', function ($hasQuery) {
$hasQuery->where(function ($subQuery) {
$subQuery
->orWhere('name', 'like', '%换声%')
->orWhere('name', 'like', '%换脸%')
->orWhere('name', 'like', '%换头%')
@imzhi
imzhi / .eslintrc.json
Created January 11, 2021 07:59
vscode eslint配置文件
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"airbnb-base"
],
"parserOptions": {
"sourceType": "module",