[ Update 2025-03-24: Commenting is disabled permanently. Previous comments are archived at web.archive.org. ]
Most of the terminal emulators auto-detect when a URL appears onscreen and allow to conveniently open them (e.g. via Ctrl+click or Cmd+click, or the right click menu).
It was, however, not possible until now for arbitrary text to point to URLs, just as on webpages.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @-moz-document domain("baidu.com") { | |
| body { | |
| display: none; | |
| } | |
| html { | |
| margin: 30px; | |
| } | |
| html::after { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function setUserAgent(window, userAgent) { | |
| // Works on Firefox, Chrome, Opera and IE9+ | |
| if (navigator.__defineGetter__) { | |
| navigator.__defineGetter__('userAgent', function () { | |
| return userAgent; | |
| }); | |
| } else if (Object.defineProperty) { | |
| Object.defineProperty(navigator, 'userAgent', { | |
| get: function () { | |
| return userAgent; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| " http://usevim.com/2013/01/04/vim101-jumping/ | |
| function! InitJavaScript() | |
| setl suffixesadd+=.js | |
| setl isfname+=@-@ | |
| let node_modules = finddir('node_modules', expand('%:p:h') . ';') | |
| exec "setl path+=". node_modules | |
| "let project_root=findfile('package.json', expand('%:p:h') . ';') | |
| "exec "setl path+=". fnamemodify(project_root, ':p:h') . "/node_modules" | |
| endfunction |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # vim: sw=4 ts=4 et tw=100 cc=+1 | |
| # | |
| #################################################################################################### | |
| # DESCRIPTION # | |
| #################################################################################################### | |
| # | |
| # Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to | |
| # compress e. g. bookmark backups (*.jsonlz4). | |
| # |
Create a runner shell script in host -> init with:
- 2GB RAM
- Host CPU with 2 Cores
- Localhost port 2222 traffic redirect to guest port 22
- Spice display with copy and paste enabled
#!/bin/sh
SPICE_PORT=5924
SPARK_IMG=/home/hoa/spark-training.qcow2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python3 | |
| # | |
| # Dumb script to dump (some) of bcache status | |
| # Copyright 2013 Darrick J. Wong. All rights reserved. | |
| # | |
| # This file is part of Bcache. Bcache is free software: you can | |
| # redistribute it and/or modify it under the terms of the GNU General Public | |
| # License as published by the Free Software Foundation, version 2. | |
| # | |
| # This program is distributed in the hope that it will be useful, but WITHOUT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ LD_PRELOAD=$PWD/sendmsg.so dig twitter.com @8.8.8.8 | |
| ;; Warning: Message parser reports malformed message packet. <-- malformed 因为把压缩指针当作域名一部分了 | |
| ;; Question section mismatch: got twitter.com/RESERVED0/CLASS256 | |
| ; <<>> DiG 9.9.5-3-Ubuntu <<>> twitter.com @8.8.8.8 | |
| ;; global options: +cmd | |
| ;; Got answer: | |
| ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44722 | |
| ;; flags: qr rd ra; QUERY: 1, ANSWER: 4, AUTHORITY: 0, ADDITIONAL: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Data.List | |
| -- 第一行照写,第二行开头加空格反写;如果不够一行,前面加空格填充 | |
| arrange :: Int -> String -> [String] | |
| arrange n str | |
| | n == 1 = [str] | |
| | length str <= n = [str] | |
| | length str <= (2*n-1) = [take n str,replicate (2*n-1 - length str) ' ' ++ reverse (drop n str) ++ " "] | |
| | otherwise = arrange n (take (2*n-1) str) ++ arrange n (drop (2*n-1) str) |