Skip to content

Instantly share code, notes, and snippets.

View skypesky's full-sized avatar
🍉

JianChao Ye skypesky

🍉
View GitHub Profile
@skypesky
skypesky / all-mock.spec.js.md
Last active July 19, 2023 11:34
mock 写法大全

How to mock deeply nested objects?

const states = require('states');

jest.mock('states', () => ({ auditLog: { find: jest.fn(() => []) } }));

expect(states.auditLog.find).toBeCalled();
# sudo apt -y install ubuntu-desktop task-gnome-desktop
# sudo reboot

Ubuntu

sudo apt-get install zsh 
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Ubuntu && MacOS 之间如何复制文件

scp ~/local-folder [email protected]:~/remote-folder
@skypesky
skypesky / pm2.grafana.json
Last active May 6, 2025 14:03
monitor system
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
@skypesky
skypesky / nginx.grafana.json
Last active May 7, 2025 07:16
Nginx Grafana Dashboard Json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
@skypesky
skypesky / dolt.grafana.json
Last active May 8, 2025 01:16
Dolt grafana config json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@skypesky
skypesky / uptime.grafana.json
Created May 7, 2025 14:03
Uptime grafana json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
@skypesky
skypesky / redis.grafana.json
Last active May 9, 2025 07:02
Redis grafana json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
@skypesky
skypesky / cloud-resources.grafana.json
Last active May 23, 2025 01:06
Cloud Resources grafana json
{
"annotations": {
"list": [
{
"$$hashKey": "object:2875",
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},