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 sheet:shortcut { | |
echo ' | |
ctrl+A ctrl+E ─┐ | |
┌─────────┬──────────┐ │ | |
│ alt+B │ alt+F │ ├─► Moving | |
│ ┌──────┼────┐ │ │ | |
▼ ▼ │ ▼ ▼ ─┘ | |
$ cp assets-|files dist/ | |
◄────── ────► ─┐ | |
ctrl+W alt+D │ |
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 { existsSync } from 'fs' | |
import { inspect } from 'util' | |
import { Service } from '@umijs/core' | |
const isDev = process.env.NODE_ENV === 'development' | |
const umiService = new Service({ | |
cwd: process.cwd(), |
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
#!/bin/sh | |
':' // ; exec node --experimental-modules --experimental-specifier-resolution=node "$0" "$@" | |
// hack for pass multiple arguments in shebang | |
// The colon(:) is shell built-in command, which means do nothing, whatever its parameters are. | |
// https://stackoverflow.com/questions/48179714/how-can-an-es6-module-be-run-as-a-script-in-node | |
import xxx from 'xxx' |
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 fs from 'fs' | |
import path from 'path' | |
const libs = [ | |
'Affix', | |
'Alert', | |
'Anchor', | |
'AutoComplete', | |
'BackTop', |
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
# find merge-request which contains commit in GitLab | |
# https://gitlab.com/gitlab-org/gitlab-foss/-/issues/28037 | |
# https://stackoverflow.com/a/17819027/7277090 | |
git config --add remote.origin.fetch '+refs/merge-requests/*/head:refs/remotes/origin/merge-requests/*' | |
git fetch origin | |
git for-each-ref --contains <hash> | grep merge-requests | head -n 10 |
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
# print 256-color pattern | |
function sheet:color { | |
local block row col fg_color bg_color | |
local i | |
print -P "$( | |
echo -n '\n' | |
# the 16 base colors | |
for i in {0..15}; do |
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 gen_ssl_cert { | |
local prefix="${1}" | |
openssl genrsa -des3 -out "${prefix}.lock.key" 1024 | |
openssl rsa -in "${prefix}.lock.key" -out "${prefix}.key" | |
rm "${prefix}.lock.key" | |
openssl req -new -key "${prefix}.key" -out "${prefix}.csr" | |
openssl x509 -req -days 3650 -in "${prefix}.csr" -signkey "${prefix}.key" -out "${prefix}.crt" | |
openssl pkcs12 -export -inkey "${prefix}.key" -in "${prefix}.crt" -out "${prefix}.pfx" |
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
// https://github.com/yudai/gotty | |
// [string] Address to listen, all addresses will be used when empty | |
address = "localhost" | |
// [string] Port to listen | |
// ywwuyi 6655 | |
port = "6655" | |
// [bool] Permit clients to write to the TTY |
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 React from 'react' | |
import { injectGlobal } from 'emotion' | |
React.__origin_createElement = React.createElement | |
React.createElement = ((type, props, ...children) => { | |
const createElement = React.__origin_createElement | |
if (type === null || type === undefined || typeof type === 'string') { |
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 bash | |
# curl -o- https://gist.githubusercontent.com/zthxxx/607b8793885197ff61fb79a3d9db25cb/raw/kill-SymDaemon.sh | bash | |
launchctl unload /Library/LaunchAgents/com.symantec.uiagent.application.*plist | |
sudo launchctl unload /Library/LaunchDaemons/com.symantec.*.plist | |
sudo rm -rf /Library/LaunchAgents/com.symantec.uiagent.application.*plist /Library/LaunchDaemons/com.symantec.*.plist | |
ps -ef | grep -i symantec |