新建test.ahk,然后运行即可。

  1. #InstallKeybdHook
  2. #Persistent
  3. Hotstring("EndChars", "`n") ; 设置为回车键作为终止符(`t为回车键)
  4.  
  5. ; 当前版本号
  6. V = 0.0.4
  7.  
  8. ; 版本获取
  9. try {
  10. _V := ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/version", true, "")
  11. } catch e {
  12.  
  13. }
  14.  
  15. ; 版本不一致,提示是否要下载最新的
  16. if (V != _V) {
  17. MsgBox, 4, 温馨提示, 检测到你本地的DRY并非最新的,是否要前往下载?
  18. IfMsgBox Yes
  19. Run, https://raw.githubusercontent.com/dragon8github/ahk/master/DRY.exe
  20. }
  21.  
  22. ; ____________________ 全局变量 ___________________________
  23. Menu, MyMenu, add
  24.  
  25. ; ALT + R 重启脚本
  26. !r::
  27. Send, ^s
  28. reload
  29. Return
  30.  
  31. ; 我阿里云的ip,方便我记忆
  32. >^i::
  33. SendRaw, 119.23.22.136
  34. return
  35.  
  36. >^p::
  37. Var =
  38. (
  39. pxToRem
  40. )
  41. code(Var)
  42. return
  43.  
  44. >^v::
  45. run, http://vuejs.org/
  46. run, http://vuex.vuejs.org
  47. run, http://router.vuejs.org
  48. run, https://github.com/opendigg/awesome-github-vue
  49. return
  50.  
  51. >^r::
  52. SendRaw, npm run dev
  53. return
  54.  
  55. >^l::
  56. SendRaw, http://localhost:8080
  57. return
  58.  
  59. ::baidu::
  60. SendRaw, http://www.baidu.com
  61. return
  62.  
  63. >^e::
  64. run, http://element-cn.eleme.io/#/zh-CN/component/radio
  65. run, https://github.com/ElemeFE/element/blob/dev/packages/
  66. run, https://github.com/ElemeFE/mint-ui
  67. run, http://elemefe.github.io/mint-ui/#/
  68. return
  69.  
  70. >^f::
  71. run, http://fontawesome.dashgame.com/
  72. return
  73.  
  74. ; 获取当前ip,分为1234四个网卡
  75. ::ip1::
  76. SendInput, % A_IPAddress1
  77. return
  78.  
  79. ::ip2::
  80. SendInput, % A_IPAddress2
  81. return
  82.  
  83. ::ip3::
  84. SendInput, % A_IPAddress3
  85. return
  86.  
  87. ::ip4::
  88. SendInput, % A_IPAddress4
  89. return
  90.  
  91. +!c::
  92. SendInput, ^c ;^a
  93. Sleep, 150
  94. Menu, MyMenu, DeleteAll
  95. MyVar := clipboard
  96. clipboard := ""
  97. RegExMatch(MyVar, "i)(\b\w+\b)(?CCallout)")
  98. Callout(m) {
  99. if (StrLen(m) >= 3 and StrLen(m) < 20) {
  100. clipboard .= m . ","
  101. }
  102. return 1
  103. }
  104. MyVar := clipboard
  105. Sort MyVar, U D,
  106. ; D默认使用逗号作为分隔符,U移除重复项
  107. Sort MyVar, U D,
  108. ColorArray := StrSplit(MyVar, ",")
  109. Loop % ColorArray.MaxIndex() {
  110. this_color := ColorArray[a_index]
  111. Menu, MyMenu, Add, %this_color%, MenuHandler
  112. }
  113. TrayTip, 生成成功, (づ ̄3 ̄)づ╭❤~ 按下 Ctrl + x 可以启动, 20, 17
  114. MenuHandler:
  115. SendRaw, %A_ThisMenuItem%
  116. Return
  117. return
  118.  
  119. !x::
  120. Menu, MyMenu, Show
  121. Return
  122.  
  123. ::git::
  124. SendInput, rm -rf *.bak && git add . && git commit -m '' && git push -u origin master{LEFT 30}
  125. Return
  126.  
  127. ::auth::
  128. SendInput, Authorization
  129. return
  130.  
  131. ; 关闭输入法
  132. ; 使用示例:SwitchIME(0x08040804)
  133. ; 使用示例:SwitchIME(0x04090409)
  134. SwitchIME(dwLayout){
  135. HKL:=DllCall("LoadKeyboardLayout", Str, dwLayout, UInt, 1)
  136. ControlGetFocus,ctl,A
  137. SendMessage,0x50,0,HKL,%ctl%,A
  138. }
  139.  
  140. !a::
  141. MouseGetPos, MouseX, MouseY
  142. PixelGetColor, color, %MouseX%, %MouseY%, RGB
  143. Clipboard := "#" . SubStr(color, 3)
  144. TrayTip, my title, current color is `n %Clipboard%, 20, 17
  145. return
  146.  
  147. >^b::
  148. RUN, https://www.baidu.com/
  149. RUN, http://www.cnblogs.com/cylee
  150. Return
  151.  
  152. ^g::
  153. RUN, https://www.github.com/
  154. RUN, https://legacy.gitbook.com/
  155. Return
  156.  
  157. ^+d::
  158. InputBox, OutputVar, title, enter your download url?
  159. if (OutputVar != "") {
  160. text := ajax(OutputVar)
  161. RUN, notepad
  162. WinWaitActive, 无标题 - 记事本, , 2
  163. if ErrorLevel {
  164. MsgBox, WinWait timed out.
  165. }
  166. else {
  167. ; 这里需要聚焦一下
  168. Winactivate
  169. code(text)
  170. }
  171. }
  172. return
  173.  
  174. ; 快速搜索音乐
  175. >^m::
  176. InputBox, OutputVar, title, enter a music name?
  177. if (OutputVar != "")
  178. {
  179. RUN, http://music.163.com/#/search/m/?s=%OutputVar%
  180. RUN, https://y.qq.com/portal/search.html#w=%OutputVar%
  181. RUN, https://www.xiami.com/search?key=%OutputVar%
  182. RUN, http://www.kugou.com/yy/html/search.html#searchType=song&searchKeyWord=%OutputVar%
  183. }
  184. return
  185.  
  186. !s::
  187. Clipboard =
  188. Send, ^c
  189. ClipWait, 2
  190. RUN, https://www.zhihu.com/search?type=content&q=%Clipboard%
  191. RUN, https://segmentfault.com/search?q=%Clipboard%
  192. RUN, https://www.google.com/search?q=%Clipboard%
  193. RUN, https://stackoverflow.com/search?q=%Clipboard%
  194. RUN, https://www.baidu.com/s?wd=%Clipboard%
  195. return
  196.  
  197. !q::
  198. ; 第一步,将当前剪切板的内容保存起来,然后清空
  199. tmp := Clipboard
  200. Clipboard =
  201. ; 第二步,复制当前选中内容
  202. SendInput, ^c
  203. ClipWait, 2
  204. if (StrLen(Clipboard) >= 10) {
  205. MsgBox, 请不要把此功能当做翻译机
  206. return
  207. }
  208. ; 有道翻译API(暂废弃)
  209. ; Var := ajax("http://119.23.22.136:6634/index.php?text=" . Clipboard . "&type=_")
  210. ; 百度翻译API
  211. Var := ajax("http://119.23.22.136:6634/baidu_transapi.php?text=" . Clipboard . "&type=_")
  212. ; 切换到英文(关闭中文输入法)
  213. SwitchIME(0x08040804)
  214. ; 黏贴结果
  215. SendInput, % Var
  216. ; 这里考虑剪切板要tmp的数据,还是翻译的数据。暂时保存翻译结果吧
  217. Clipboard := Var
  218. Return
  219.  
  220. ^!q::
  221. ; 第一步,将当前剪切板的内容保存起来,然后清空
  222. tmp := Clipboard
  223. Clipboard =
  224. ; 第二步,复制当前选中内容
  225. SendInput, ^c
  226. ClipWait, 2
  227. if (StrLen(Clipboard) >= 10) {
  228. MsgBox, 请不要把此功能当做翻译机
  229. return
  230. }
  231. ; 百度翻译API
  232. Var := ajax("http://119.23.22.136:6634/baidu_transapi.php?text=" . Clipboard . "&type=tuofeng")
  233. ; 切换到英文
  234. SwitchIME(0x08040804)
  235. ; 黏贴结果
  236. SendInput, % Var
  237. ; 这里考虑剪切板要tmp的数据,还是翻译的数据。暂时保存翻译结果吧
  238. Clipboard := Var
  239. Return
  240.  
  241. +!q::
  242. ; 第一步,将当前剪切板的内容保存起来,然后清空
  243. tmp := Clipboard
  244. Clipboard =
  245. ; 第二步,复制当前选中内容
  246. SendInput, ^c
  247. ClipWait, 2
  248. ; 百度翻译API
  249. Var := ajax("http://119.23.22.136:6634/baidu_transapi.php?text=" . Clipboard . "&type=_", true)
  250. TrayTip, 翻译成功, 翻译结果为: %Var%, 20, 17
  251. ; 这里考虑剪切板要tmp的数据,还是翻译的数据。暂时保存翻译结果吧
  252. Clipboard := Var
  253. Return
  254.  
  255. !space::
  256. InputBox, OutputVar, title, what's your Q?
  257. if (ErrorLevel == 0)
  258. {
  259. RUN, https://www.zhihu.com/search?type=content&q=%OutputVar%
  260. RUN, https://segmentfault.com/search?q=%OutputVar%
  261. RUN, https://www.google.com/search?q=%OutputVar%
  262. RUN, https://stackoverflow.com/search?q=%OutputVar%
  263. RUN, https://www.baidu.com/s?wd=%OutputVar%
  264. }
  265. Return
  266.  
  267. >^j::
  268. RUN, http://youmightnotneedjquery.com/
  269. RUN, https://wyagd001.github.io/zh-cn/docs/Tutorial.htm
  270. Return
  271.  
  272. ; 复制黏贴大段文本
  273. code(code)
  274. {
  275. ; MsgBox, %code%
  276. tmp := Clipboard
  277. Clipboard := code
  278. SendInput, ^V
  279. ; 这里至少需要等待50m
  280. sleep, 50
  281. Clipboard := tmp
  282. }
  283.  
  284. ; 下载内容
  285. ajax(url, q:=false, text:="正在为你下载代码,请保持网络顺畅")
  286. {
  287. whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
  288. whr.Open("GET", url, true)
  289. whr.Send()
  290. if (text != "") {
  291. TrayTip, 请稍后, % text, 20, 17
  292. }
  293. whr.WaitForResponse()
  294.  
  295. if (q==false) {
  296. if (whr.ResponseText) {
  297. TrayTip, 下载成功, (づ ̄3 ̄)づ╭❤~ , 20, 17
  298. } else {
  299. TrayTip, 无内容返回, ( ̄ε(# ̄)☆╰╮o( ̄皿 ̄///) , 20, 17
  300. }
  301. }
  302.  
  303. return whr.ResponseText
  304. }
  305.  
  306. ; https://tool.lu/imageholder/ 其实完全可以自己实现。算了,网上有的是这种服务
  307. ::img::
  308. SendInput, <img src="https://iph.href.lu/400x400" alt="..." />{left 14}{ShiftDown}{left 7}{ShiftUp}
  309. Return
  310.  
  311. ; ______________________ css ______________________
  312.  
  313. ::bg-cover::
  314. SendRaw, background: url(img/tiger.jpg) 0 / cover;
  315. return
  316.  
  317. ::@bg::
  318. SendInput,
  319. (
  320. width: 100px`;
  321. height: 100px`;
  322. background: url('https://iph.href.lu/100x100') center / 100`% 100`% no-repeat`;
  323. display: inline-block`;
  324. )
  325. return
  326.  
  327. ::size::
  328. SendInput,
  329. (
  330. width: px`;
  331. height: px`;
  332. )
  333. return
  334.  
  335. ::fs::
  336. SendInput, font-size: 14px`;{left 3}+{left 2}
  337. Return
  338.  
  339. ::bg::
  340. SendInput,background: url('https://iph.href.lu/100x100') center center / 130px 130px no-repeat content-box`;
  341. Return
  342.  
  343. ::bgc::
  344. SendInput, background-color: {#}ffffff`;{left}+{left 6}
  345. Return
  346.  
  347. ::bgi::
  348. SendInput, background: url('') no-repeat`;{left 13}
  349. Return
  350.  
  351. ::margin::
  352. SendRaw, margin: 0 auto;
  353. return
  354.  
  355. ::arrow::
  356. Var =
  357. (
  358. .triangle {
  359. border-left: 50px solid transparent;
  360. border-right: 50px solid transparent;
  361. border-bottom: 50px solid orange;
  362. width: 0;
  363. height: 0;
  364. }
  365. )
  366. code(Var)
  367. return
  368.  
  369. ::arrow-top::
  370. Var =
  371. (
  372. .triangle {
  373. border-left: 50px solid transparent;
  374. border-right: 50px solid transparent;
  375. border-bottom: 50px solid orange;
  376. width: 0;
  377. height: 0;
  378. }
  379. )
  380. code(Var)
  381. return
  382.  
  383. ::arrow-right::
  384. Var =
  385. (
  386. .triangle {
  387. border-top: 50px solid transparent;
  388. border-bottom: 50px solid transparent;
  389. border-left: 50px solid orange;
  390. width: 0;
  391. height: 0;
  392. }
  393. )
  394. code(Var)
  395. return
  396.  
  397. ::arrow-bottom::
  398. Var =
  399. (
  400. .triangle {
  401. border-left: 50px solid transparent;
  402. border-right: 50px solid transparent;
  403. border-top: 50px solid orange;
  404. width: 0;
  405. height: 0;
  406. }
  407. )
  408. code(Var)
  409. return
  410.  
  411. ::arrow-left::
  412. Var =
  413. (
  414. .triangle {
  415. border-top: 50px solid transparent;
  416. border-bottom: 50px solid transparent;
  417. border-right: 50px solid orange;
  418. width: 0;
  419. height: 0;
  420. }
  421. )
  422. code(Var)
  423. return
  424.  
  425. ::wh::
  426. SendInput,
  427. (
  428. width: px`;
  429. height: px`;^!{up}^{left}
  430. )
  431. Return
  432.  
  433. ::w::
  434. SendInput, width: px;{left 3}
  435. Return
  436.  
  437. ::h::
  438. SendInput, height: px;{left 3}
  439. Return
  440.  
  441. ::ell::
  442. SendInput,
  443. (
  444. overflow: hidden`;
  445. text-overflow: ellipsis`;
  446. white-space: nowrap`;
  447. )
  448. Return
  449.  
  450. ::lh::
  451. SendInput,
  452. (
  453. height: px;
  454. line-height: px;^!{up}^{left}
  455. )
  456. Return
  457.  
  458. ::text-a::
  459. SendInput, text-align: center`;
  460. Return
  461.  
  462. ::ta::
  463. SendInput, text-align: center`;
  464. Return
  465.  
  466. ::tc::
  467. SendInput, text-align: center`;
  468. Return
  469.  
  470. ::tl::
  471. SendInput, text-align: left`;
  472. Return
  473.  
  474. ::tr::
  475. SendInput, text-align: right`;
  476. Return
  477.  
  478. ::t-a::
  479. SendInput, text-align: center`;
  480. Return
  481.  
  482. ::t-c::
  483. SendInput, text-align: center`;
  484. Return
  485.  
  486. ::t-r::
  487. SendInput, text-align: right`;
  488. Return
  489.  
  490. ::t-l::
  491. SendInput, text-align: left`
  492. Return
  493.  
  494. ::fl::
  495. SendInput, float: left`;
  496. Return
  497.  
  498. ::fr::
  499. SendInput, float: right`;
  500. Return
  501.  
  502. ::border-t::
  503. SendInput, border-top: 1px solid {#}ccc`;
  504. Return
  505.  
  506. ::border-r::
  507. SendInput, border-right: 1px solid {#}ccc`;
  508. Return
  509.  
  510. ::border-b::
  511. SendInput, border-bottom: 1px solid {#}ccc`;
  512. Return
  513.  
  514. ::border-l::
  515. SendInput, border-left: 1px solid {#}ccc`;
  516. Return
  517.  
  518. ::bt::
  519. SendInput, border-top: 1px solid {#}ccc`;
  520. Return
  521.  
  522. ::br::
  523. SendInput, border-right: 1px solid {#}ccc`;
  524. Return
  525.  
  526. ::bb::
  527. SendInput, border-bottom: 1px solid {#}ccc`;
  528. Return
  529.  
  530. ::bl::
  531. SendInput, border-left: 1px solid {#}ccc`;
  532. Return
  533.  
  534. ::mb::
  535. SendInput, margin-bottom: px`;{left 3}
  536. Return
  537.  
  538. ::mt::
  539. SendInput, margin-top: px`;{left 3}
  540. Return
  541.  
  542. ::ml::
  543. SendInput, margin-left: px`;{left 3}
  544. Return
  545.  
  546. ::mr::
  547. SendInput, margin-right: px`;{left 3}
  548. Return
  549.  
  550. ::pb::
  551. SendInput, padding-bottom: px`;{left 3}
  552. Return
  553.  
  554. ::pt::
  555. SendInput, padding-top: px`;{left 3}
  556. Return
  557.  
  558. ::pl::
  559. SendInput, padding-left: px`;{left 3}
  560. Return
  561.  
  562. ::pr::
  563. SendInput, padding-right: px`;{left 3}
  564. Return
  565.  
  566. ::posa::
  567. SendRaw, position: absolute;
  568. Return
  569.  
  570. ::posr::
  571. SendRaw, position: relative;
  572. Return
  573.  
  574. ::posf::
  575. SendInput,
  576. (
  577. position: fixed`;
  578. left: 0`;
  579. right: 0`;
  580. top: 0`;
  581. z-index: 199307100337`;
  582. )
  583. Return
  584.  
  585. ::box::
  586. SendInput,box-sizing: border-box`;
  587. Return
  588.  
  589. ::flexw::
  590. Var =
  591. (
  592. display: flex;
  593. flex-wrap: wrap;
  594. )
  595. code(Var)
  596. return
  597.  
  598. ::flexc::
  599. SendInput,
  600. (
  601. display: flex`;
  602. justify-content: center`;
  603. )
  604. Return
  605.  
  606. ::flexa::
  607. SendInput,
  608. (
  609. display: flex`;
  610. justify-content: space-around`;
  611. )
  612. Return
  613.  
  614. ::flexs::
  615. SendInput,
  616. (
  617. display: flex`;
  618. justify-content: flex-start`;
  619. )
  620. Return
  621.  
  622. ::flexe::
  623. SendInput,
  624. (
  625. display: flex`;
  626. justify-content: flex-end`;
  627. )
  628. Return
  629.  
  630. ::flexcc::
  631. SendInput,
  632. (
  633. display: flex`;
  634. justify-content: center`;
  635. align-items: center`;
  636. )
  637. Return
  638.  
  639. ::flexac::
  640. SendInput,
  641. (
  642. display: flex`;
  643. justify-content: space-around`;
  644. align-items: center`;
  645. )
  646. Return
  647.  
  648. ::flexb::
  649. Var =
  650. (
  651. display: flex;
  652. justify-content: space-between;
  653. align-items: center;
  654. )
  655. code(Var)
  656. return
  657.  
  658. ::flexbs::
  659. Var =
  660. (
  661. display: flex;
  662. justify-content: space-between;
  663. align-items: flex-start;
  664. )
  665. code(Var)
  666. return
  667.  
  668. ::flexbc::
  669. Var =
  670. (
  671. display: flex;
  672. justify-content: space-between;
  673. align-items: center;
  674. )
  675. code(Var)
  676. return
  677.  
  678. ::flexbe::
  679. Var =
  680. (
  681. display: flex;
  682. justify-content: space-between;
  683. align-items: flex-end;
  684. )
  685. code(Var)
  686. return
  687.  
  688. ::flexss::
  689. SendInput,
  690. (
  691. display: flex`;
  692. justify-content: flex-start`;
  693. align-items: flex-start`;
  694. )
  695. Return
  696.  
  697. ::flexsc::
  698. SendInput,
  699. (
  700. display: flex`;
  701. justify-content: flex-start`;
  702. align-items: center`;
  703. )
  704. Return
  705.  
  706. ::flexee::
  707. SendInput,
  708. (
  709. display: flex`;
  710. justify-content: flex-end`;
  711. align-items: flex-end`;
  712. )
  713. Return
  714.  
  715. ::flexec::
  716. SendInput,
  717. (
  718. display: flex`;
  719. justify-content: flex-end`;
  720. align-items: center`;
  721. )
  722. Return
  723.  
  724. ::`:before::
  725. SendInput,
  726. (
  727. ::before {{}{}}{left}
  728. content: " "`;
  729. position:absolute`;
  730.  
  731. )
  732. Return
  733.  
  734. ::`:after::
  735. SendInput,
  736. (
  737. ::after {{}{}}{left}
  738. content: " "`;
  739. position:absolute`;
  740.  
  741. )
  742. Return
  743.  
  744. ::center::
  745. SendInput,
  746. (
  747. position: absolute`;
  748. left: 50`%`;
  749. top: 50`%`;
  750. transform: translate(-50`%, -50`%)`;
  751. )
  752. Return
  753.  
  754. ::xcenter::
  755. SendInput,
  756. (
  757. position: absolute`;
  758. left: 50`%`;
  759. transform: translateX(-50`%)`;
  760. )
  761. Return
  762.  
  763. ::ycenter::
  764. SendInput,
  765. (
  766. position: absolute`;
  767. top: 50`%`;
  768. transform: translateY(-50`%)`;
  769. )
  770. Return
  771.  
  772. ::@media::
  773. Var =
  774. (
  775. /* 移动设备断点,视图宽度 <= 768px */
  776. @media (max-width: 768px) {
  777.  
  778. }
  779.  
  780. /* 移动设备断点,视图宽度 >= 769px */
  781. @media (min-width: 769px and max-width: 1024) {
  782.  
  783. }
  784.  
  785. /* 移动设备断点,视图宽度 >= 1024px */
  786. @media (min-width: 1024px and max-width: 1216px) {
  787.  
  788. }
  789.  
  790. /* 移动设备断点,视图宽度 >= 1216 */
  791. @media (min-width: 1216px) {
  792.  
  793. }
  794. )
  795. code(Var)
  796. Return
  797.  
  798. ::style::
  799. Var =
  800. (
  801. <style lang="scss" scoped>
  802.  
  803. </style>
  804. )
  805. code(Var)
  806. return
  807.  
  808. ::`!imp::
  809. SendRaw, !important
  810. return
  811.  
  812. ::tran::
  813. SendRaw, transparent
  814. return
  815.  
  816. ::trans::
  817. SendInput, transition
  818. return
  819.  
  820. ::transf::
  821. SendInput, transform
  822. return
  823.  
  824. ::link-media::
  825. SendInput, <link rel="stylesheet" media="(max-width: 640px)" href="app640.css">
  826. Return
  827.  
  828. ::border-1px::
  829. Var =
  830. (
  831. /* 1 物理像素线(也就是普通屏幕下 1px ,高清屏幕下 0.5px 的情况)采用 transform 属性 scale 实现 */
  832. .mod_grid {
  833. position: relative;
  834. &::after {
  835. /* 实现1物理像素的下边框线 */
  836. content: '';
  837. position: absolute;
  838. z-index: 1;
  839. pointer-events: none;
  840. background-color: #ddd;
  841. height: 1px;
  842. left: 0;
  843. right: 0;
  844. top: 0;
  845. @media only screen and (-webkit-min-device-pixel-ratio: 2) {
  846. -webkit-transform: scaleY(0.5);
  847. -webkit-transform-origin: 50`% 0`%;
  848. }
  849. }
  850. }
  851. )
  852. code(Var)
  853. Return
  854.  
  855. ::box-shadow::
  856. SendRaw, box-shadow: 0 2px 12px 0 rgba(212, 212, 212, 0.1);
  857. return
  858.  
  859. ::box-shadow2::
  860. Var =
  861. (
  862. box-shadow: 0 0 0 1px hsla(0, 0`%, 100`%, .3) inset,
  863. 0 .5em 1em rgba(0, 0, 0, 0.6);
  864. )
  865. code(Var)
  866. return
  867.  
  868. ::chrome-yellow::
  869. Var =
  870. (
  871. input:-webkit-autofill {
  872. -webkit-box-shadow: 0 0 0px 1000px white inset !important;
  873. }
  874. )
  875. code(Var)
  876. return
  877.  
  878. ::forof::
  879. Var =
  880. (
  881. for (const a of gen) {
  882. console.log(a);
  883. }
  884. )
  885. code(Var)
  886. return
  887.  
  888. ; ______________________ JavaScript ______________________
  889.  
  890. ::node-http::
  891. Var =
  892. (
  893. var http = require('http');
  894.  
  895. var server = http.createServer(function (req, rep) {
  896. rep.writeHead(200, {"Content-Type": "text/plain"});
  897. rep.end("Hello World!!");
  898. })
  899.  
  900. server.listen(3000, function (err) {
  901. console.log('start');
  902. });
  903. )
  904. code(Var)
  905. Return
  906.  
  907. >^d::
  908. SendInput, debugger{;}
  909. Return
  910.  
  911. >^c::
  912. SendInput, console.log(arguments)`;{left 2}
  913. Return
  914.  
  915. ::con::
  916. SendInput, console.log()`;{left 2}
  917. Return
  918.  
  919. ::log::
  920. SendInput, console.log()`;{left 2}
  921. Return
  922.  
  923. ::console::
  924. SendInput, console.log(arguments)`;{left 2}
  925. Return
  926.  
  927. ::ret::
  928. SendInput, return
  929. Return
  930.  
  931. ::pro::
  932. SendInput, prototype
  933. return
  934.  
  935. ::args::
  936. SendInput, arguments
  937. Return
  938.  
  939. ::json.p::
  940. SendInput, JSON.parse(){left}
  941. Return
  942.  
  943. ::json.s::
  944. SendInput, JSON.stringify(){left}
  945. Return
  946.  
  947. ::/json::
  948. SendRaw, application/json;charset=utf-8
  949. Return
  950.  
  951. ::json/::
  952. SendRaw, application/json;charset=utf-8
  953. Return
  954.  
  955. ::/form::
  956. SendRaw, application/x-www-form-urlencoded;charset=utf-8
  957. Return
  958.  
  959. ::_::
  960. Var =
  961. (
  962. _ => {}
  963. )
  964. code(Var)
  965. SendInput, {left}{enter}
  966. Return
  967.  
  968. ::=>::
  969. Var =
  970. (
  971. => {}
  972. )
  973. code(Var)
  974. SendInput, {left}{enter}
  975. Return
  976.  
  977. ::func::
  978. Var =
  979. (
  980. function () {}
  981. )
  982. code(Var)
  983. SendInput, {left}{enter}
  984. Return
  985.  
  986. ::f::
  987. Var =
  988. (
  989. function () {}
  990. )
  991. code(Var)
  992. SendInput, {left}{enter}
  993. Return
  994.  
  995. ::()()::
  996. Var =
  997. (
  998. (function(){
  999.  
  1000. }());
  1001. )
  1002. code(Var)
  1003. SendInput, {up}{tab}
  1004. Return
  1005.  
  1006. ::$click::
  1007. Var =
  1008. (
  1009. $(".object").click(function () {
  1010.  
  1011. });
  1012. )
  1013. code(Var)
  1014. SendInput, {up}{tab}
  1015. Return
  1016.  
  1017. ::$change::
  1018. Var =
  1019. (
  1020. $(".object").change(function () {
  1021.  
  1022. });
  1023. )
  1024. code(Var)
  1025. SendInput, {up}{tab}
  1026. Return
  1027.  
  1028. ::`:?::
  1029. SendInput, foo === bar ? true `: false`;
  1030. Return
  1031.  
  1032. ::sett::
  1033. Var =
  1034. (
  1035. setTimeout(function () {
  1036.  
  1037. }, 1000);
  1038. )
  1039. code(Var)
  1040. SendInput, {up}{tab}
  1041. Return
  1042.  
  1043. ::setti::
  1044. Var =
  1045. (
  1046. setInterval(function () {
  1047.  
  1048. }, 1000);
  1049. )
  1050. code(Var)
  1051. SendInput, {up}{tab}
  1052. Return
  1053.  
  1054. ::ctimer::
  1055. Var =
  1056. (
  1057. var timer = setTimeout(function () {
  1058. clearTimeout(timer);
  1059. }, 1000);
  1060. )
  1061. code(Var)
  1062. Return
  1063.  
  1064. ::ctimeri::
  1065. Var =
  1066. (
  1067. var timer = setInterval(function () {
  1068. clearInterval(timer);
  1069. }, 1000);
  1070. )
  1071. code(Var)
  1072. Return
  1073.  
  1074. ::$each::
  1075. Var =
  1076. (
  1077. $.each($('.object'), function (i, e) {
  1078. console.log(i, e);
  1079. });
  1080. )
  1081. code(Var)
  1082. Return
  1083.  
  1084. ::.each::
  1085. Var =
  1086. (
  1087. .each(function (i, e) {
  1088. console.log(i, e);
  1089. });
  1090. )
  1091. code(Var)
  1092. Return
  1093.  
  1094. ::foreach::
  1095. Var =
  1096. (
  1097. [1,2,3,4].forEach(function (e, i) {
  1098. console.log(i, e);
  1099. });
  1100. )
  1101. code(Var)
  1102. Return
  1103.  
  1104. ::dg::
  1105. SendInput, document.getElementById('')`;{left 3}
  1106. Return
  1107.  
  1108. ::ds::
  1109. SendInput, document.querySelectorAll('')`;{left 3}
  1110. Return
  1111.  
  1112. ::.then::
  1113. SendInput, .then(_ => {{}{}}).catch(err => {{}{}})`;{left 3}{enter 2}{UP 2}{Home}{right 12}{enter 2}{up}{tab}
  1114. Return
  1115.  
  1116. ::throw::
  1117. SendInput, throw new Error(e.message){left}^+{left}^+{left}
  1118. Return
  1119.  
  1120. >!f::
  1121. Var =
  1122. (
  1123. for (var i = Things.length - 1; i >= 0; i--) {
  1124. Things[i]
  1125. }
  1126. )
  1127. code(Var)
  1128. Return
  1129.  
  1130. !f::
  1131. Var =
  1132. (
  1133. for (var i = 0; i < Things.length; i) {
  1134. Things[i]
  1135. }
  1136. )
  1137. code(Var)
  1138. Return
  1139.  
  1140. ::forin::
  1141. SendInput, for (var property in source) {{}{}}{left}{enter}console.log(source[property]);
  1142. Return
  1143.  
  1144. ::switch::
  1145. SendInput,
  1146. (
  1147. switch (data) {{}{}}{left}{enter 2}{up}{tab}case 0`:
  1148. break`;
  1149. case 1`:
  1150. break`;
  1151. default`:
  1152.  
  1153. )
  1154. return
  1155.  
  1156. ::date::
  1157. Var =
  1158. (
  1159. var date = new date();
  1160. var year = date.getFullYear();
  1161. var month = date.getMonth() + 1;
  1162. var day = date.getate();
  1163. var hour = date.getHours();
  1164. var minutes = date.getMinutes();
  1165. var seconds= date.getSeconds();
  1166. console.log(year + "/" + month + "/" + day + "/ " + hour + ":" + minutes + ":" + seconds);
  1167. console.log(year + "年" + month + "月" + day + "日 " + hour + "时" + minutes + "分" + seconds + "秒");
  1168. )
  1169. code(Var)
  1170. return
  1171.  
  1172. ::cdate::
  1173. SendInput, var mydate = new Date(time.replace(/\-/g, "/"))`;
  1174. Return
  1175.  
  1176. ::date.y::
  1177. SendInput, new Date().getFullYear()`;
  1178. Return
  1179.  
  1180. ::datey::
  1181. SendInput, new Date().getFullYear()`;
  1182. Return
  1183.  
  1184. ::date.year::
  1185. SendInput, new Date().getFullYear()`;
  1186. Return
  1187.  
  1188. ::date.m::
  1189. SendInput, new Date().getMonth() {+} 1`;
  1190. Return
  1191.  
  1192. ::date.month::
  1193. SendInput, new Date().getMonth() {+} 1`;
  1194. Return
  1195.  
  1196. ::datem::
  1197. SendInput, new Date().getMonth() {+} 1`;
  1198. Return
  1199.  
  1200. ::date.d::
  1201. SendInput, new Date().getDate()`;
  1202. Return
  1203.  
  1204. ::dated::
  1205. SendInput, new Date().getDate()`;
  1206. Return
  1207.  
  1208. ::date.day::
  1209. SendInput, new Date().getDate()`;
  1210. Return
  1211.  
  1212. ::date.h::
  1213. SendInput, new Date().getHours()`;
  1214. Return
  1215.  
  1216. ::dateh::
  1217. SendInput, new Date().getHours()`;
  1218. Return
  1219.  
  1220. ::date.hour::
  1221. SendInput, new Date().getHours()`;
  1222. Return
  1223.  
  1224. ::date.mm::
  1225. SendInput, new Date().getMinutes()`;
  1226. Return
  1227.  
  1228. ::datemm::
  1229. SendInput, new Date().getMinutes()`;
  1230. Return
  1231.  
  1232. ::date.s::
  1233. SendInput, new Date().getSeconds()`;
  1234. Return
  1235.  
  1236. ::date.ss::
  1237. SendInput, new Date().getSeconds()`;
  1238. Return
  1239.  
  1240. ::$create::
  1241. SendInput,
  1242. (
  1243. var wrap = document.createElement("div");
  1244. var first = document.body.firstChild;
  1245. var wraphtml = document.body.insertBefore(wrap,first);
  1246. )
  1247. Return
  1248. ::random::
  1249. SendInput, parseInt(Math.random() * 10 {+} 1); // 获取 1 - 10 到随机数
  1250. Return
  1251.  
  1252. ::rand::
  1253. SendInput, parseInt(Math.random() * 10 {+} 1); // 获取 1 - 10 到随机数
  1254. Return
  1255.  
  1256. ::repeat::
  1257. SendRaw, Array.prototype.join.call({length: i + 1}, '你确定?')
  1258. Return
  1259.  
  1260. !/::
  1261. Var =
  1262. (
  1263. /**
  1264. * say something ...
  1265. */
  1266. )
  1267. code(Var)
  1268. Return
  1269.  
  1270. +!/::
  1271. Var =
  1272. (
  1273. /**
  1274. * say something ...
  1275. * @param {*} 参数 说明
  1276. */
  1277. )
  1278. code(Var)
  1279. return
  1280.  
  1281. ::getuuid::
  1282. Var =
  1283. (
  1284. function getUUID () {
  1285. return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
  1286. return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
  1287. })
  1288. }
  1289. )
  1290. code(Var)
  1291. return
  1292.  
  1293. ; ____________ CDN _______________
  1294. ::cdn-font::
  1295. SendRaw, <link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
  1296. return
  1297.  
  1298. ::cdn-axios::
  1299. SendRaw, <script src="https://cdn.bootcss.com/axios/0.18.0/axios.min.js"></script>
  1300. Return
  1301.  
  1302. ::cdn-swiper::
  1303. Var =
  1304. (
  1305. <link href="https://cdn.bootcss.com/Swiper/4.2.2/css/swiper.css" rel="stylesheet">
  1306. <script src="https://cdn.bootcss.com/Swiper/4.2.2/js/swiper.min.js"></script>
  1307. )
  1308. code(Var)
  1309. Return
  1310.  
  1311. ::cdn-jquery3::
  1312. Var =
  1313. (
  1314. <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
  1315. )
  1316. code(Var)
  1317. Return
  1318.  
  1319. ::cdn-jquery1.9::
  1320. Var =
  1321. (
  1322. <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
  1323. )
  1324. code(Var)
  1325. Return
  1326.  
  1327. ::cdn-jquery::
  1328. Var =
  1329. (
  1330. <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
  1331. )
  1332. code(Var)
  1333. Return
  1334.  
  1335. ::cdn-jq::
  1336. Var =
  1337. (
  1338. <script src="https://cdn.bootcss.com/jquery/1.9.1/jquery.min.js"></script>
  1339. )
  1340. code(Var)
  1341. Return
  1342.  
  1343. ::cdn-vue::
  1344. Var =
  1345. (
  1346. <script src="https://cdn.bootcss.com/vue/2.5.16/vue.min.js"></script>
  1347. )
  1348. code(Var)
  1349. Return
  1350.  
  1351. ::cdn-bs::
  1352. Var =
  1353. (
  1354. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
  1355. <script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  1356. )
  1357. code(Var)
  1358. Return
  1359.  
  1360. ::cdn-bootstrap::
  1361. Var =
  1362. (
  1363. <link rel="stylesheet" href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css">
  1364. <script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
  1365. )
  1366. code(Var)
  1367. Return
  1368.  
  1369. ::cdn-reset::
  1370. Var =
  1371. (
  1372. <link href="https://cdn.bootcss.com/normalize/8.0.0/normalize.min.css" rel="stylesheet">
  1373. )
  1374. code(Var)
  1375. return
  1376.  
  1377. ::cdn-normalize::
  1378. Var =
  1379. (
  1380. <link href="https://cdn.bootcss.com/normalize/8.0.0/normalize.min.css" rel="stylesheet">
  1381. )
  1382. code(Var)
  1383. return
  1384.  
  1385. ;_______________ Vue ______________________
  1386.  
  1387. ::mapgetters::
  1388. Var =
  1389. (
  1390. // https://vuex.vuejs.org/en/getters.html
  1391. import { mapGetters } from 'vuex'
  1392. computed: {
  1393. ...mapGetters([
  1394. 'menuList'
  1395. ]),
  1396. ...mapGetters({
  1397. menuList: 'menuList'
  1398. })
  1399. },
  1400. )
  1401. return
  1402.  
  1403. ::mapmutations::
  1404. Var =
  1405. (
  1406. // https://vuex.vuejs.org/en/getters.html
  1407. import { mapMutations } from 'vuex'
  1408. methods: {
  1409. ...mapMutations([
  1410. 'SET_MENU',
  1411. 'SET_USERINFO'
  1412. ]),
  1413. ...mapMutations({
  1414. SET_MENU 'SET_MENU',
  1415. SET_USERINFO 'SET_USERINFO'
  1416. }),
  1417. },
  1418. )
  1419. return
  1420.  
  1421. ::dispatch::
  1422. SendInput, this.$store.dispatch('').then(_ => {{} {}}){left 2}{enter 2}{up}{tab} // ...
  1423. Return
  1424.  
  1425. ::v-for::
  1426. SendInput, v-for='(item, index) in items' :key='index'
  1427. Return
  1428.  
  1429. ; ______________________ HTML _____________________
  1430.  
  1431. ::div::
  1432. Var =
  1433. (
  1434. <div></div>
  1435. )
  1436. code(Var)
  1437. Send, {left 6}
  1438. return
  1439.  
  1440. ::html`:5::
  1441. Var =
  1442. (
  1443. <!DOCTYPE html>
  1444. <html lang="en">
  1445. <head>
  1446. <meta charset="UTF-8">
  1447. <meta name="viewport" content="width=device-width, initial-scale=1">
  1448. <title>Document</title>
  1449. </head>
  1450. <style>
  1451. </style>
  1452. <body>
  1453.  
  1454. </body>
  1455. <script>
  1456. </script>
  1457. </html>
  1458. )
  1459. code(Var)
  1460. Return
  1461.  
  1462. ::meta::
  1463. SendInput, <meta name="viewport" content="width=device-width, initial-scale=1">
  1464. Return
  1465.  
  1466. ::nocache::
  1467. (
  1468. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  1469. <!-- HTTP 1.1 -->
  1470. <meta http-equiv="pragma" content="no-cache">
  1471. <!-- HTTP 1.0 -->
  1472. <meta http-equiv="cache-control" content="no-cache">
  1473. <!-- Prevent caching at the proxy server -->
  1474. <meta http-equiv="expires" content="0">
  1475. <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE9" />
  1476. )
  1477. Return
  1478.  
  1479. ::art::
  1480. SendRaw, <article></article>
  1481. return
  1482.  
  1483. ::table-cell::
  1484. Var =
  1485. (
  1486. /**
  1487. * 父元素,table-cell兼容到IE8
  1488. *
  1489. * 缺点1:margin属性会失效(但子元素不影响),因为margin不适用于表格布局。
  1490. * 解决1:再外层多套一个div容器,然后对这个容器display:block;margin: 0 auto;即可
  1491. *
  1492. * 缺点2:使用display: table-cell;的元素设置宽高百分比的时候将不起作用,譬如想设置为外层的100`%宽度
  1493. * 解决2:如果只是想随着外层的100`%,还是有方法的,那就是设置一个很大的值,如3000px
  1494. *
  1495. * 缺点3:当元素设置为position: absolute;的时候会失效。
  1496. * 解决3:参考解决1,在外层套一个容器,将absolute作用于该容器即可。
  1497. * 但这样一来,又会导致缺点2的问题,也就是宽高百分比失效。所以要看场景使用。
  1498. * 实在不行可以使用:
  1499. position: relative;
  1500. top: 50`%;
  1501. transform: translateY(-50`%);
  1502. 加上-webkit-前缀后,兼容性可以达到IE9。
  1503. 也可以采用margin-top: 负元素的高度。但需要知道高度,无法根据内容长度自适应。
  1504. */
  1505. .my-container {
  1506. display: table-cell;
  1507. vertical-align: middle;
  1508. }
  1509. )
  1510. code(Var)
  1511. return
  1512.  
  1513. ::middle::
  1514. SendRaw, vertical-align: middle;
  1515. return
  1516.  
  1517. ::fig::
  1518. Var =
  1519. (
  1520. <figure>
  1521. <img src="https://iph.href.lu/100x100" alt="..." />
  1522. <figcaption>explanatory caption</figcaption>
  1523. </figure>
  1524. )
  1525. code(Var)
  1526. return
  1527.  
  1528. ::fig-span::
  1529. Var =
  1530. (
  1531. <style>
  1532. .my-container {
  1533. display: table-cell;
  1534. vertical-align: middle;
  1535. background-color: red;
  1536. height:500px;
  1537. }
  1538. img, span {
  1539. /**
  1540. * 以前我以为只有display:table-cell;可以使用。
  1541. * 现在才发现原来只要是行内元素都可以,更意外的是,img居然也是一个行内元素。
  1542. */
  1543. vertical-align: middle;
  1544. }
  1545. </style>
  1546. <body>
  1547. <figure class="my-container">
  1548. <img src="https://iph.href.lu/100x100" alt="..." />
  1549. <span>explanatory caption</span>
  1550. </figure>
  1551. </div>
  1552. )
  1553. code(Var)
  1554. return
  1555.  
  1556. ; _____________________ php _______________________
  1557.  
  1558. ::header::
  1559. Var =
  1560. (
  1561. header('Access-Control-Allow-Origin:*');
  1562. header('Access-Control-Allow-Headers:Content-Type,Content-Length, Authorization,Origin,Accept,X-Requested-With');
  1563. header('Access-Control-Allow-Methods:GET,POST);
  1564. header('Access-Control-Allow-Credentials:true');
  1565. header("Content-type: text/html; charset=utf-8");
  1566. )
  1567. code(Var)
  1568. Return
  1569.  
  1570. ::header-utf8::
  1571. SendRaw, header("Content-type: text/html; charset=utf-8");
  1572. Return
  1573.  
  1574. ; _____________________ regExp _______________________
  1575.  
  1576. ::is-cn::
  1577. Var =
  1578. (
  1579. if (!/^[\u4e00-\u9fa5]+$/.test('李钊鸿')) {
  1580. throw new Error('请输入中文汉字')
  1581. }
  1582. )
  1583. code(Var)
  1584. return
  1585.  
  1586. ::is-phone::
  1587. Var =
  1588. (
  1589. /^([0-9]{3,4}-)?[0-9]{7,8}$/.test(s)
  1590. )
  1591. code(Var)
  1592. return
  1593.  
  1594. ::is-pwd::
  1595. SendRaw, /[A-Za-z].*[0-9]|[0-9].*[A-Za-z]/.test('123456a@') ; /* 必须同时包含数字和字母,支持非法符号 */
  1596. Return
  1597.  
  1598. ::is-user::
  1599. SendRaw, /^[a-zA-Z0-9-_]*$/.test(''); /* 由6-16位数字、 字母、 '_'、 '-'组成,不含特殊字符*/
  1600. Return
  1601.  
  1602. ::is-id::
  1603. Var =
  1604. (
  1605. if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test('445222199307100337')){
  1606. throw new Error('非法身份证')
  1607. }
  1608. )
  1609. code(Var)
  1610. return
  1611.  
  1612. ::is-email::
  1613. SendRaw, /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((.[a-zA-Z0-9_-]{2,3}){1,2})$/.test(s)
  1614. Return
  1615.  
  1616. ; _______________ snippets ______________
  1617.  
  1618. >^a::
  1619. Var =
  1620. (
  1621. $.ajax({
  1622. url: "http://localhost:3000",
  1623. type: "post",
  1624. data: JSON.stringify({
  1625. test: 123
  1626. }),
  1627. headers: {
  1628. token: '123'
  1629. },
  1630. dataType: 'json',
  1631. contentType: 'application/json;charset=utf-8',
  1632. success: function (data) {
  1633. console.log(data);
  1634. }
  1635. })
  1636. )
  1637. code(Var)
  1638. Return
  1639.  
  1640. ::ajax::
  1641. Var =
  1642. (
  1643. $.ajax({
  1644. url: "http://localhost:8089/index.php",
  1645. type: "post",
  1646. data: {},
  1647. headers: {
  1648. token: '123'
  1649. },
  1650. dataType: 'json',
  1651. contentType: 'application/json;charset=utf-8',
  1652. success: function (data) {
  1653. console.log(data);
  1654. },
  1655. error: function(e, m){
  1656. console.log('数据接口请求异常', e, m);
  1657. }
  1658. })
  1659. )
  1660. code(Var)
  1661. Return
  1662.  
  1663. ::walert::
  1664. SendRaw, window.alert('123');
  1665. return
  1666.  
  1667. ; _______________________________ 本地代码库 _______________________________
  1668. >!v::
  1669. Var =
  1670. (
  1671. <template>
  1672. <div class="test">
  1673. test
  1674. </div>
  1675. </template>
  1676.  
  1677. <script>
  1678. export default {
  1679. name: 'test',
  1680. data () {
  1681. return {
  1682. myData: []
  1683. }
  1684. },
  1685. methods: {
  1686. go () {
  1687. console.log('go');
  1688. }
  1689. },
  1690. components: {
  1691.  
  1692. },
  1693. beforeMount () {
  1694. console.log('test');
  1695. }
  1696. }
  1697. </script>
  1698.  
  1699. <style lang="scss" scoped>
  1700. .test {
  1701.  
  1702. }
  1703. </style>r
  1704. )
  1705. code(Var)
  1706. return
  1707.  
  1708. ::extend::
  1709. Var =
  1710. (
  1711. // 拷贝集成
  1712. var extend = function (destination, source) {
  1713. for (var property in source)
  1714. destination[prototype] = source[prototype]
  1715. return destination
  1716. }
  1717. )
  1718. code(Var)
  1719. Return
  1720.  
  1721. ::gettop::
  1722. Var =
  1723. (
  1724. // 获取距离顶部的相对距离
  1725. function getElementTop(element){
  1726. try {
  1727.      var actualTop = element.offsetTop;
  1728.      var current = element.offsetParent;
  1729.      while (current !== null){
  1730.        actualTop += current.offsetTop;
  1731.        current = current.offsetParent;
  1732.      }
  1733.      return actualTop;
  1734. } catch (e) {}
  1735. }
  1736. )
  1737. code(Var)
  1738. Return
  1739.  
  1740. ::pad::
  1741. Var =
  1742. (
  1743. // 补全
  1744. function pad (target, n) {
  1745. var zero = new Array(n).join('0');
  1746. var str = zero + target;
  1747. var result = str.substr(-n);
  1748. return result;
  1749. }
  1750. )
  1751. code(Var)
  1752. Return
  1753.  
  1754. ::goTop::
  1755. Var =
  1756. (
  1757. var timer = null;
  1758. var goTop = function() {
  1759. cancelAnimationFrame(timer);
  1760. timer = requestAnimationFrame(function fn() {
  1761. var oTop = document.body.scrollTop || document.documentElement.scrollTop;
  1762. if (oTop > 0) {
  1763. document.body.scrollTop = document.documentElement.scrollTop = oTop - 500;
  1764. timer = requestAnimationFrame(fn);
  1765. } else {
  1766. cancelAnimationFrame(timer);
  1767. }
  1768. });
  1769. }
  1770. )
  1771. code(Var)
  1772. Return
  1773.  
  1774. ::uniqueArray::
  1775. Var =
  1776. (
  1777. /**
  1778. * 只用 Array
  1779. * 如果是 es6 推荐: return Array.from(new Set(arr));
  1780. */
  1781. function uniqueArray(arr) {
  1782. var retArray = [];
  1783. for (var i = 0; i < arr.length; i) {
  1784. retArray.push(arr[i]);
  1785. }
  1786. Return retArray;
  1787. }
  1788. )
  1789. code(Var)
  1790.  
  1791. ::env::
  1792. SendRaw, process.env.NODE_ENV === 'production|development'
  1793. return
  1794.  
  1795. ; _______________________________ 云代码库 _______________________________
  1796.  
  1797. ::vue_template::
  1798. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/vue_template.vue"))
  1799. Return
  1800.  
  1801. ::aop::
  1802. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/AOP.js"))
  1803. Return
  1804.  
  1805. ::__EVENT__::
  1806. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/__EVENT__.js"))
  1807. Return
  1808.  
  1809. ::normalize::
  1810. code(ajax("https://raw.githubusercontent.com/necolas/normalize.css/master/normalize.css"))
  1811. Return
  1812.  
  1813. ::fuck-rem::
  1814. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/rem.scss"))
  1815. Return
  1816.  
  1817. ::hover-nav::
  1818. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/hover-nav.html"))
  1819. Return
  1820.  
  1821. ::myhtml::
  1822. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/myhtml.html"))
  1823. return
  1824.  
  1825. ::myexpress::
  1826. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/myexpress1.js"))
  1827. return
  1828.  
  1829. ::myexpress2::
  1830. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/myexpress1.js"))
  1831. return
  1832.  
  1833. ::express-proxy::
  1834. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/express-proxy.js"))
  1835. return
  1836.  
  1837. ::proxy::
  1838. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/express-proxy.js"))
  1839. return
  1840.  
  1841. ::node-nginx::
  1842. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/express-proxy.js"))
  1843. return
  1844.  
  1845. ::node-nginx2::
  1846. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/node-nginx.js"))
  1847. return
  1848.  
  1849. ::glass::
  1850. code(ajax("https://raw.githubusercontent.com/dragon8github/ahk/master/snippets/glass.html"))
  1851. return
  1852.  
  1853. ; ___________________ hongte _______________________
  1854.  
  1855. ::ht.loading::
  1856. Var =
  1857. (
  1858. <!-- http://element-cn.eleme.io/#/zh-CN/component/loading -->
  1859. const loading = this.$loading({lock: true, text: 'Loading', spinner: 'el-icon-loading', background: 'rgba(0, 0, 0, 0.7)'});
  1860. setTimeout(() => {
  1861. loading.close();
  1862. }, 2000);
  1863. )
  1864. code(Var)
  1865. return
  1866.  
  1867. ::ht.post::
  1868. Var =
  1869. (
  1870. this.$http.post('/uaa/auth/login', {
  1871. "userName": "admin-salary",
  1872. "password": "123456"
  1873. }).then(result => {
  1874. console.log(result);
  1875. }).catch(err => {
  1876. this.$message.error('接口异常:' + err.message);
  1877. })
  1878. )
  1879. code(Var)
  1880. return
  1881.  
  1882. ::ht.get::
  1883. Var =
  1884. (
  1885. this.$http.get('/uc/auth/loadMenu').then(result => {
  1886. console.log(result);
  1887. }).catch(err => {
  1888. this.$message.error('接口异常:' + err.message);
  1889. })
  1890. )
  1891. code(Var)
  1892. return
  1893.  
  1894. ::ht.card::
  1895. Var =
  1896. (
  1897. <!-- http://element-cn.eleme.io/#/zh-CN/component/card -->
  1898. <el-card class="box-card">
  1899. <div slot="header" class="clearfix">
  1900. <span>卡片名称</span>
  1901. <el-button style="float: right; padding: 3px 0" type="text">操作按钮</el-button>
  1902. </div>
  1903. <div v-for="o in 4" :key="o" class="text item">
  1904. {{'列表内容 ' + o }}
  1905. </div>
  1906. </el-card>
  1907. )
  1908. code(Var)
  1909. return
  1910.  
  1911. ::ht.input::
  1912. Var =
  1913. (
  1914. <!-- http://element-cn.eleme.io/#/zh-CN/component/input -->
  1915. 姓名: <el-input placeholder="请输入你的姓名" suffix-icon="el-icon-date" v-model="input"> </el-input>
  1916. )
  1917. code(Var)
  1918. return
  1919.  
  1920. ::ht.form::
  1921. Var =
  1922. (
  1923. <!-- http://element-cn.eleme.io/#/zh-CN/component/form -->
  1924. <el-form ref="form" :model="form" label-width="80px">
  1925. <el-form-item label="活动名称">
  1926. <el-input v-model="form.name"></el-input>
  1927. </el-form-item>
  1928. <el-form-item label="活动区域">
  1929. <el-select v-model="form.region" placeholder="请选择活动区域">
  1930. <el-option label="区域一" value="shanghai"></el-option>
  1931. <el-option label="区域二" value="beijing"></el-option>
  1932. </el-select>
  1933. </el-form-item>
  1934. <el-form-item label="活动时间">
  1935. <el-col :span="11">
  1936. <el-date-picker type="date" placeholder="选择日期" v-model="form.date1" style="width: 100`%;"></el-date-picker>
  1937. </el-col>
  1938. <el-col class="line" :span="2">-</el-col>
  1939. <el-col :span="11">
  1940. <el-time-picker type="fixed-time" placeholder="选择时间" v-model="form.date2" style="width: 100`%;"></el-time-picker>
  1941. </el-col>
  1942. </el-form-item>
  1943. <el-form-item label="即时配送">
  1944. <el-switch v-model="form.delivery"></el-switch>
  1945. </el-form-item>
  1946. <el-form-item label="活动性质">
  1947. <el-checkbox-group v-model="form.type">
  1948. <el-checkbox label="美食/餐厅线上活动" name="type"></el-checkbox>
  1949. <el-checkbox label="地推活动" name="type"></el-checkbox>
  1950. <el-checkbox label="线下主题活动" name="type"></el-checkbox>
  1951. <el-checkbox label="单纯品牌曝光" name="type"></el-checkbox>
  1952. </el-checkbox-group>
  1953. </el-form-item>
  1954. <el-form-item label="特殊资源">
  1955. <el-radio-group v-model="form.resource">
  1956. <el-radio label="线上品牌商赞助"></el-radio>
  1957. <el-radio label="线下场地免费"></el-radio>
  1958. </el-radio-group>
  1959. </el-form-item>
  1960. <el-form-item label="活动形式">
  1961. <el-input type="textarea" v-model="form.desc"></el-input>
  1962. </el-form-item>
  1963. <el-form-item>
  1964. <el-button type="primary" @click="onSubmit">立即创建</el-button>
  1965. <el-button>取消</el-button>
  1966. </el-form-item>
  1967. </el-form>
  1968. form: {
  1969. name: '',
  1970. region: '',
  1971. date1: '',
  1972. date2: '',
  1973. delivery: false,
  1974. type: [],
  1975. resource: '',
  1976. desc: ''
  1977. }
  1978. )
  1979. code(Var)
  1980. return
  1981.  
  1982. ::ht.msg::
  1983. SendRaw, this.$message.error('接口异常:' + err.message);
  1984. return
  1985.  
  1986. ; _______________________________ second_keyboard _______________________________
  1987. ~^F12::
  1988. ; 获取指定位置的数值
  1989. FileRead, key, C:\Users\lizhaohong\Desktop\keypressed.txt
  1990.  
  1991. ; b 百度
  1992. if (key == 66) {
  1993. RUN, http://www.cnblogs.com/cylee
  1994. }
  1995.  
  1996. ; 1 代表输入贷后系统的账号密码
  1997. if (key == 97) {
  1998. ; 关闭输入法
  1999. SwitchIME(0x08040804)
  2000. ; 输入账号
  2001. SendInput, admin-alms
  2002. ; 切换到密码框
  2003. SendInput, {tab}
  2004. Sleep 200
  2005. ; 输入密码
  2006. SendRaw, hongte123
  2007. Sleep 200
  2008. SendInput, {enter}
  2009. }
  2010.  
  2011. ; 1 代表输入信贷系统的账号密码
  2012. if (key == 98) {
  2013. ; 关闭输入法
  2014. SwitchIME(0x08040804)
  2015. ; 输入账号
  2016. SendInput, admin
  2017. ; 切换到密码框
  2018. SendInput, {tab}
  2019. Sleep 200
  2020. ; 输入密码
  2021. SendRaw, hongte@2018
  2022. Sleep 200
  2023. SendInput, {enter}
  2024. }
  2025.  
  2026. ; 1 代表输入薪资系统的账号密码
  2027. if (key == 99) {
  2028. ; 关闭输入法
  2029. SwitchIME(0x08040804)
  2030. ; 输入账号
  2031. SendInput, HX-04397
  2032. ; 切换到密码框
  2033. SendInput, {tab}
  2034. Sleep 200
  2035. ; 输入密码
  2036. SendRaw, 123456
  2037. Sleep 200
  2038. SendInput, {enter}
  2039. }
  2040.  
  2041. ; 【d】跳转到贷后系统
  2042. if (key == 68) {
  2043. RUN, http://172.16.200.112:30601/index
  2044. }
  2045.  
  2046. ; 【p】发送post代码
  2047. if (key == 80) {
  2048. Var =
  2049. (
  2050. this.$http.post('/uaa/auth/login', {
  2051. "userName": "admin-salary",
  2052. "password": "123456"
  2053. }).then(result => {
  2054. console.log(result);
  2055. }).catch(err => {
  2056. this.$message.error('接口异常:' + err.message);
  2057. })
  2058. )
  2059. code(Var)
  2060. }
  2061.  
  2062. ; 【p】发送post代码
  2063. if (key == 71) {
  2064. Var =
  2065. (
  2066. this.$http.get('/uc/auth/loadMenu').then(result => {
  2067. console.log(result);
  2068. }).catch(err => {
  2069. this.$message.error('接口异常:' + err.message);
  2070. })
  2071. )
  2072. code(Var)
  2073. }
  2074.  
  2075. if (key == 76) {
  2076. run, http://localhost:8080
  2077. }
  2078.  
  2079. if (key == 86) {
  2080. run, http://vuejs.org/
  2081. run, http://vuex.vuejs.org
  2082. run, http://router.vuejs.org
  2083. run, https://github.com/opendigg/awesome-github-vue
  2084. }
  2085.  
  2086. if (key == 69) {
  2087. run, http://element-cn.eleme.io/#/zh-CN/component/radio
  2088. run, https://github.com/ElemeFE/element/blob/dev/packages/
  2089. run, https://github.com/ElemeFE/mint-ui
  2090. run, http://elemefe.github.io/mint-ui/#/
  2091. }
  2092.  
  2093. if (key == 88) {
  2094. run, http://172.16.200.106:8083/
  2095. }
  2096.  
  2097. if (key == 83) {
  2098. run, http://172.16.200.121:31501/index
  2099. }

autoHotKey 一些脚本积累的更多相关文章

  1. AutoHotkey 自动化脚本工具实例

    AHK 自动按键工具 https://www.autohotkey.com/ 可实现功能 快捷键 启动 浏览器.CMD命令.弹出框 可定时执行任务 可改键 将A与B互换 可快捷替换字符串 测试如下: ...

  2. AutoHotKey 常用脚本

    ; IMPORTANT INFO ABOUT GETTING STARTED: Lines that start with a ; semicolon, such as this one, are c ...

  3. shell脚本积累

    统计当前目录下文件夹的大小 for d in $(ls) do du -sh ./$d done 获取之前日期date  +"%Y%m%d" -d  "-n days&q ...

  4. Win下最爱效率利器:AutoHotKey

    AutoHotkey是一个windows下的开源.免费.自动化软件工具.它由最初旨在提供键盘快捷键的脚本语言驱动(称为:热键),随着时间的推移演变成一个完整的脚本语言.但你不需要把它想得太深,你只需要 ...

  5. autohotkey在运维中的应用

         AutoHotkey是一个自由.开源的宏生成器和自动化软件工具,它让用户能够自动执行重复性任务.AutoHotkey可以修改任何应用程序的用户界面(例如,把默认的Windows按键控制命令替 ...

  6. 用Autohotkey让powerpoint幻灯片一直播放

    有台电脑专门接了个大电视循环播放一个幻灯片,但是有时候会弹出一些对话框,比如windows要更新之类的,这样的话powerpoint就不是active的进城了,这样幻灯片就会停下来,还需要人去手动点一 ...

  7. AutoHotKey 用打码的快捷键

    本文告诉大家如何使用 AutoHotKey 将 - 键默认输入的时候是下划线,因为使用下划线在写代码的时候是用在私有字段,而 - 很少使用 我打码经常需要使用下划线_而下划线需要按shift+- 两个 ...

  8. 20150916_001 vba 基础

    一.什么是“宏”.“宏”有什么用 关于“宏”的详细定义,可以参考百度百科的解释(点击查看).我给它一个简单的或许不太严谨的定义: 宏的通俗定义:宏是被某些软件所能识别.理解并执行的特定代码/脚本. 宏 ...

  9. AutoIT 测试GUI工具

    今天听到同事提到AutoIT,可以用来测试GUI窗口.了解一下这个工具. 以下内容引自: http://www.jb51.net/article/14870.htm (此url非原出处,该博主未注明原 ...

随机推荐

  1. head first---------facade design pattern

    head first----------外观模式或者门面模式         外观模式又名门面模式:提供了一个统一的接口,用来访问子系统中的一群接口.外观模式定义了一个高层接口,从而让子系统更容易使用 ...

  2. setTimeout你知多少

    假期这么快就结束了,其实对我来说没什么影响,因为我一周才两节课,对于课多的同学来说,我天天在休假,不要羡慕哟~  但休假并不代表闲着,还是得苦逼的编代码,唉..一入程序深似海.. 不管学得多少,还是总 ...

  3. win8升级8.1提示卸载sentinel runtime drivers

    Win8升级8.1时提示需卸载sentinel runtime drivers的解决方法 第一步:打开sentinelcustomer.safenet-inc.com/sentineldownload ...

  4. 嵌入式linux内核和根目录制作

    系统组成:Bootloader, Boot parameters, Kernel, Root filesystem嵌入式linux系统有linux内核与根文件系统两部分构成,两者缺一不可. 内核制作: ...

  5. 2013年,移动App设计的13大精髓

    摘要:在 过去的一年里,移动成主流也让众多的移动应用如雨后春笋般层出不穷,在众多开发者从中获利的同时竞争也愈演愈烈,如何才能保证自己立于不败之地?用户是上 帝,一切还得从应用说起.本文总结了新一年里A ...

  6. Android RadioButton设置选中时文字和背景颜色同时改变

    主要应用在购物车,像淘宝的那样,点击以后弹出一个选择种类颜色这样的popuwindow以后,然后这个选择种类的地方要用到类似这个玩意儿. 搜了一下,效果和这个文章一致.转了. 原文地址:http:// ...

  7. 安卓源码下载 windows

    git clone https://android.googlesource.com/name Name Descriptionaccessories/manifest device/asus/deb ...

  8. WEB漏洞挖掘技术总结

    漏洞挖掘技术一直是网络攻击者最感兴趣的问题,漏洞挖掘的范围也在随着技术的提升而有所变化.在前期针对缓冲区溢出.格式化字符串.堆溢出.lib库溢出等技术都是针对ELF文件(Linux可执行文件)或者PE ...

  9. 无法对数据库'XXX' 执行删除,因为它正用于复制"的解决方

    困扰二天的问题终于得以解决,貌似一个棘手的问题只要知道方法也似乎变得异常简单,记录此次的解决方法,避免遗忘. 无法对 数据库'UDS' 执行 删除,因为它正用于复制. (.Net SqlClient ...

  10. centos7 selenium.common.exceptions.WebDriverException: Message: 'chromedriver' executable needs to be in PATH

    1.查看安装的chrome浏览器版本 2.查看版本对应的驱动 https://sites.google.com/a/chromium.org/chromedriver/downloads 下载后拷贝到 ...