Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
<img src="x" onerror="alert(1)" />

Wei Zhu yesmeck

:octocat:
<img src="x" onerror="alert(1)" />
View GitHub Profile
@yesmeck
yesmeck / toolbar.js
Created Jan 4, 2021
Kitchen toolbar
View toolbar.js
const agentView = NSStackView.alloc().init();
const container = NSView.alloc().initWithFrame(NSMakeRect(0, 0, UI.TOOLBAR_DEFAULT_WIDTH, 400));
container.identifier = pluginConstant.BAR_CONTAINER;
container.addSubview(agentView);
const viewsDictionary = { container, stack: agentView };
const horizontalConstraints = NSLayoutConstraint.constraintsWithVisualFormat_options_metrics_views(
'H:|-0-[stack]-0-|',
0,
nil,
@yesmeck
yesmeck / key.pub
Created Apr 7, 2020
My GPG Public key
View key.pub
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBF6MTcYBEACk2Q+j0zJvzNYsxmkIMA5QzeFeHRxPRI/r1c9jjipJx/0O13JW
UItAQpAPYLcPTtq3lj0g6qjXrcHrnHsQ6rJDO92Fu124GVG47gxDY8FLQoY7Wgci
jZ9JwndFZIULpCLwDxqSFeAX12Zxx3a3SloBzfvLnYOKng/jqYfCMlfnW4T7Tbe3
p/6zwHMdHPdTbCnz9OUk4YilHT4wJB6+8bfIQ0l2P5xd0ghrbovtWehKVGNiAenL
ptypjFC1RvRInvHYhWlFo5TOBHb3HufWM+JM8Oy34gIiaAbCkoq+LHQCUYVmIqed
okqLnFmn0yxKAQ75WnkvvCcOSsmF4ZHrEJcbbTLjnGkNh+PZ5iMkMF9UG++okzSc
Bkqh59wzW1rzsCvguHZkwFExk7oFnuvKPECmUWpAi3unOlUMLY5NsnpxS9y7H4aN
qxeeHVutM0SOHTpfPMFcpSOXwZ1RyQ6cRnxaR+6uEvopARHpMnHkRdwdCVDm7n8t
View 📊 Weekly development breakdown
JavaScript 9 hrs 11 mins ███████▉░░░░░░░░░░░░░ 38.0%
TypeScript 8 hrs 29 mins ███████▍░░░░░░░░░░░░░ 35.1%
JSON 2 hrs 41 mins ██▎░░░░░░░░░░░░░░░░░░ 11.2%
Other 1 hr 44 mins █▌░░░░░░░░░░░░░░░░░░░ 7.2%
Markdown 34 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.4%
View test.md

这是一个测试

View useStore.js
interface State {
list: Trade[];
detail: Trade | null;
}
const initialState = {
list: [],
detail: null,
};
@yesmeck
yesmeck / bundle.js
Last active Sep 21, 2017
redundant __webpack_require__
View bundle.js
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
@yesmeck
yesmeck / detect-port
Created Jun 5, 2017
detect which command using port
View detect-port
#!/bin/sh
port=$1
pid=`lsof -i :${port} -P -t -sTCP:LISTEN`
dir=`lsof -p ${pid} | awk '$4=="cwd" {print $9}'`
cmd=`ps -o command -p ${pid} | sed -n 2p`
echo "${cmd} in ${dir}"
@yesmeck
yesmeck / fixit.sh
Last active Mar 9, 2017
Fix your js project!
View fixit.sh
#!/bin/sh
COLOR_GREEN='\033[0;32m'
echo "${COLOR_GREEN}Remove node_modules."
rm -rf node_modules
echo "${COLOR_GREEN}Remove yarn.lock."
rm -f yarn.lock
if command -v ayarn > /dev/null 2>&1; then
echo "${COLOR_GREEN}Install node_modules use ayarn."
View table-hover-edit.js
import { Table, Icon, Popover, Input } from 'antd';
class EditableTable extends React.Component {
constructor(props) {
super(props);
this.columns = [{
title: '应用名称',
dataIndex: 'appName',
key: 'appName',