This file contains 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
javascript: (() => { | |
/* https://github.com/storybookjs/storybook/blob/next/code/addons/outline/src/withOutline.ts */ | |
function outlineCSS(selector) { | |
return /* css */ ` | |
${selector} body { | |
outline: 1px solid #2980b9 !important; | |
} | |
${selector} article { | |
outline: 1px solid #3498db !important; |
This file contains 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
const fs = require("fs"); | |
const { exec } = require("child_process"); | |
const files = fs.readdirSync(__dirname); | |
files | |
.filter((i) => i.endsWith(".CHK")) | |
.forEach((i) => { | |
exec("file " + i, (err, stdout, stderr) => { | |
if (stdout.includes("JPEG")) { |
This file contains 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
const target = {}; | |
globalThis.original = target; | |
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy | |
const proxyObj = new Proxy(target, { | |
get(target, prop, receiver) { | |
console.log("GET", target, prop, receiver); | |
return Reflect.get(target, prop, receiver); | |
}, | |
set(target, prop, val, receiver) { |
This file contains 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
del *.lnk | |
attrib -s -h /s /d |
This file contains 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
from pygments import highlight as syntax_highlight | |
from pygments.formatters import img | |
from pygments.lexers import guess_lexer | |
lexer = guess_lexer(message) | |
formatter = img.JpgImageFormatter(style="colorful") | |
result = syntax_highlight(message, lexer, formatter, outfile=None) |
This file contains 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
{ | |
// 使用 IntelliSense 了解相关属性。 | |
// 悬停以查看现有属性的描述。 | |
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "C++", | |
"type": "cppdbg", | |
"request": "launch", |
This file contains 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
# https://psycho-pass.com/ | |
# <p data-text="THEATER">THEATER</p> | |
# p:before { | |
# content: attr(data-text); | |
# color: #24b8c6; | |
# opacity: .75; | |
# mix-blend-mode: screen; | |
# position: absolute; | |
# top: 7px; |
This file contains 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://supervisord.org/ | |
# /etc/supervisor/conf.d/app.conf | |
[program:app] | |
command=/opt/app/venv/bin/gunicorn -k gevent -w 8 -b 0.0.0.0:8080 run:app | |
directory=/opt/app | |
autostart=true | |
autorestart=true | |
user=nobody | |
redirect_stderr=true |
This file contains 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
" vim /etc/vimrc | |
" vim ~/.vimrc | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
" => General | |
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" | |
set showmode | |
set showcmd |
This file contains 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
#!/bin/bash | |
# set flag fast fail | |
set -e | |
if [[ $EUID -ne 0 ]]; then | |
echo "This script must be run as root" | |
exit 1 | |
fi |
NewerOlder