Skip to content

Instantly share code, notes, and snippets.

server {
listen 80;
server_name b.com
location /{
proxy_pass http://localhost:8080/
# 允许任何方法调用例如 OPTIONS GET POST PUT PATCH DELETE
add_header Access-Control-Allow-Methods: *;
# 跨域访问缓存时间限制,OPTIONS 预检查会被缓存,1小时均不会再重新请求
const fs = require('fs')
const path = require('path')
const fsextra = require('fs-extra');
function getControllTpl(pt) {
return `import * as assert from 'assert'
import { app } from 'egg-mock/bootstrap'
describe('${pt}', () => {
it('should GET /', async () => {
@Micjoyce
Micjoyce / mac
Created August 22, 2018 09:50 — forked from jk2K/mac
Vim配置文件 .vimrc
"不兼容vi
set nocompatible
"让删除键更好用
set backspace=2
"不创建撤销文件
set noundofile
"取消自动备份
set nobackup
"自动缩进
set autoindent
@Micjoyce
Micjoyce / meteor_download.js
Created January 18, 2018 10:31 — forked from jhgaylor/meteor_download.js
Download files to the filesystem on the meteor server
//given the urls of files to download, store them on the filesystem
function download_all_files (urls, base_destination, job_id, cb) {
var url = urls.shift();
var file_path = path.join(base_destination, job_id);
// the path to the file without the filename
var path_to_file_folder = path.dirname(file_path);
// the method to store a downloaded file to the fs
// makes an http request and writes the response to a file
@Micjoyce
Micjoyce / ios_app_upload_needs_image.txt
Created December 1, 2017 02:10 — forked from cocoajin/ios_app_upload_needs_image.txt
iOS 上传所需基本图片尺寸
/*
iOS上传所需基本图片
icon
● Icon.png – 57×57 iPhone应用图标
[email protected] – 114×114 iPhone Retina显示屏应用图标
● Icon-72.png – 72×72 iPad应用图标
@Micjoyce
Micjoyce / auth.js
Created August 11, 2017 08:24 — forked from fraserxu/auth.js
Handling CORS in Meteor app
/*
* packages/reststop2/auth.js
* Add a method to handle OPTIONS request
*/
// return nothing
RESTstop.add('login', {'method': 'OPTIONS'}, function() {})
@Micjoyce
Micjoyce / gource.sh
Created April 17, 2017 08:59 — forked from XueshiQiao/gource.sh
Generate a MP4 Video for your Git project commits using Gource!
# 1.install gource using HomeBrew
$ brew install gource
# 2.install avconv
git clone git://git.libav.org/libav.git
cd libav
# it will take 3-5 minutes to complie, be patient.
./configure --disable-yasm
make && make install
@Micjoyce
Micjoyce / gource.sh
Created April 17, 2017 08:49 — forked from cgoldberg/gource.sh
Gource - Mir development video
# install bzr and gource
# get a branch of Mir's trunk code
# create gource video
$ sudo apt-get install bzr gource
$ bzr branch lp:mir
$ cd mir
$ gource \
-s .06 \
# Get Graphics Magick
> cd /
> mkdir /dowload
> cd /download
> wget ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/GraphicsMagick-LATEST.tar.gz
> tar -xzvf GraphicsMagick-LATEST.tar.gz
> cd GraphicsMagick-1.3.21 (or the lastest graphics magick)
# Install Graphics Magick
## Get libs

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream