Skip to content

Instantly share code, notes, and snippets.

View huang-xiao-jian's full-sized avatar
🤓
On coding

黄小健 huang-xiao-jian

🤓
On coding
  • China
View GitHub Profile
@huang-xiao-jian
huang-xiao-jian / karma.bundle.js
Created November 24, 2017 08:32
karma webpack configuration
/**
* @description - karma test entry
* @author - bornkiller <hjj491229492@hotmail.com>
*/
/* eslint-disable */
'use strict';
// resolve test spec files
@huang-xiao-jian
huang-xiao-jian / gzip.conf
Created December 14, 2017 03:24
nginx gzip configuration
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 5;
gzip_proxied any;
gzip_types text/plain text/css application/javascript application/x-javascript application/xml;
gzip_vary on;
@huang-xiao-jian
huang-xiao-jian / proxy.sh
Created May 7, 2018 02:19
OSX socks 系统级代理
# 获取所有网络
# 替换下列 Ethernet
networksetup -listnetworkserviceorder;
# Set the SOCKS proxy to local SSH tunnel
networksetup -setsocksfirewallproxy "Ethernet" 127.0.0.1 1086
#To clear the domain and port
networksetup -setsocksfirewallproxy "Ethernet" 127.0.0.1 1086
# use bootcdn.cn as external resources host
library:
- name: 'web-animations-js'
linkage: 'https://unpkg.com/web-animations-js@2.3.1/web-animations.min.js'
environment:
development:
- name: 'babel-polyfill'
linkage: 'https://cdn.bootcss.com/babel-polyfill/6.26.0/polyfill.js'
- name: 'react'
linkage: 'https://cdn.bootcss.com/react/16.3.2/umd/react.development.js'
@huang-xiao-jian
huang-xiao-jian / require.context.js
Created June 1, 2018 07:00
webpack 多模块加载
const req = require.context('../src/stories', true, /\.story\.jsx?$/);
req.keys().forEach((filename) => req(filename));
@huang-xiao-jian
huang-xiao-jian / serve.config.js
Created June 1, 2018 07:01
webpack 开发服务器配置
/**
* @description - development configuration
* @author - yang.yuncai <383235388@qq.com>
*/
// dependency
const presets = require('@coco-platform/webpack-preset');
const convert = require('koa-connect');
const history = require('connect-history-api-fallback');
const proxy = require('http-proxy-middleware');
@huang-xiao-jian
huang-xiao-jian / sw.js
Created June 1, 2018 13:31
配置 workbox PWA
/**
* @description - service worker strategy
* @author - huang.jian <hjj491229492@hotmail.com>
*/
/* eslint-env worker */
/* global workbox */
// import workbox library
importScripts(
@huang-xiao-jian
huang-xiao-jian / link.extension.js
Last active June 5, 2018 06:59
Handlebars 表达式扩展
#!/usr/bin/env node
const path = require('path');
const fs = require('fs');
const fse = require('fs-extra');
const program = require('commander');
const glob = require('glob');
// internal
const welcome = require('../lib/welcome');
const { version } = require('../package.json');
@huang-xiao-jian
huang-xiao-jian / serve.config.js
Created September 25, 2018 03:32
webpack server configuration
/**
* @description - webpack server configurations
* @author - huang.jian <hjj491229492@hotmail.com>
*/
const convert = require('koa-connect');
const history = require('connect-history-api-fallback');
const proxy = require('http-proxy-middleware');
module.exports = {