Skip to content

Instantly share code, notes, and snippets.

View xvv6u577's full-sized avatar
🏠
Working from home

xm5dm62x52 xvv6u577

🏠
Working from home
View GitHub Profile
@xvv6u577
xvv6u577 / webpack.config.js
Created April 26, 2020 03:51
webpack config file
module.exports = {
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: {
loader: "babel-loader",
options: {
"presets": ["@babel/preset-env", "@babel/preset-react"],
@xvv6u577
xvv6u577 / Demo-react-redux.js
Last active April 26, 2020 03:49
Arrow function component.
import React, { Component, useState } from 'react';
import ReactDOM from 'react-dom';
import {Provider, connect} from 'react-redux'
import {createStore, combineReducers} from 'redux';
// action type
const ADD_LIST = "add_list";
const REMOVE_ITEM = "remove_item";
import { createStore } from 'redux'
/**
* This is a reducer, a pure function with (state, action) => state signature.
* It describes how an action transforms the state into the next state.
*
* The shape of the state is up to you: it can be a primitive, an array, an object,
* or even an Immutable.js data structure. The only important part is that you should
* not mutate the state object, but return a new object if the state changes.
*
* In this example, we use a `switch` statement and strings, but you can use a helper that
@xvv6u577
xvv6u577 / bashurl.md
Last active November 6, 2017 12:33
立刻运行从url获取的shell脚本
wget -O - http://www.undervineyard.com/ubuntu-SSR-install.sh | bash -
wget -O - http://www.undervineyard.com/ubuntu-SSR-install.sh | bash -s -- port password
@xvv6u577
xvv6u577 / userstrafficcheck.md
Last active November 6, 2017 12:34
SSR server users' traffic check,shell in one line
python mujson_mgr.py -l | sort -nk 4 | cut -d' ' -f4 | xargs -n 1 -I {}  python3 mujson_mgr.py -l -p {}