给终端文字加点颜色和特效 (来自 http://mozillazg.com/)
文字特效相关的字符格式是:ESC[#;#;....;#m
,其中 # 的取值见下表:
# 的值 | 功能 | python 代码 | 截图 |
---|---|---|---|
00 或 0 | 正常显示 | '\033[00m' + 'hello' + '\033[0;39m' |
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom \ | |
| while read i; do | |
sudo rm /usr/local/${i} | |
done | |
sudo rm -rf /usr/local/bin/node \ | |
/usr/local/lib/node_modules \ | |
/var/db/receipts/org.nodejs.* |
/** | |
* @file 简易光标定位 | |
* @author zfkun([email protected]) | |
*/ | |
/** | |
* 简易光标定位 | |
* | |
* @param node {(HTMLTextAreaElement | HTMLInputElement)} `TextArea`或`Input`元素 | |
* @param index {number=} 定位位置,不传则定位到末尾 |
给终端文字加点颜色和特效 (来自 http://mozillazg.com/)
文字特效相关的字符格式是:ESC[#;#;....;#m
,其中 # 的取值见下表:
# 的值 | 功能 | python 代码 | 截图 |
---|---|---|---|
00 或 0 | 正常显示 | '\033[00m' + 'hello' + '\033[0;39m' |
#!/bin/sh | |
# | |
# path: .git/hooks/pre-commit | |
echo "\n\x1B[33mCommit checking ...\x1B[0m\n" | |
npm test | |
exitCode=$? | |
if [ $exitCode -ne 0 ] |
define(function() { | |
/** | |
* create a repeat string by a string | |
* | |
* @param {string} str target string | |
* @param {number} count repeat count | |
* @return {string} | |
*/ | |
function repeat( str, count ) { |
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>audio test</title> | |
<style> | |
p { font-weight: bold; } | |
span { color: red; } | |
button { width: 100px; height: 30px; } | |
audio { display: block; margin: 5px 0; } |
/** | |
* javascript implements for `ascii2native` | |
* | |
* @file ascii2native | |
* @author zfkun([email protected]) | |
*/ | |
/** | |
* pattern 1 | |
* |
/** | |
* javascript implements for `native2ascii` | |
* | |
* @file native2ascii | |
* @author zfkun([email protected]) | |
*/ | |
/** | |
* pattern 1 | |
* |