Skip to content

Instantly share code, notes, and snippets.

Avatar

Summer summerblue

View GitHub Profile
@summerblue
summerblue / PoostApiTest.php
Created Dec 13, 2017
InfyOmLabs/laravel-generator 生成的测试 API 代码
View PoostApiTest.php
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class PoostApiTest extends TestCase
{
use MakePoostTrait, ApiTestTrait, WithoutMiddleware, DatabaseTransactions;
/**
@summerblue
summerblue / gist:e34f1c79e100c5deac20
Last active Apr 23, 2017
Using Artisan for backup-manager Auto naming convenience
View gist:e34f1c79e100c5deac20

Introduction

backup-manager is an excelent package, but lack of auto naming feature, here is a workaround using Laravel's Artisan command line tool.

Creating the command

This is the command what we are going to accomplish:

View gist:81adad02997b2860bf2e1b0b3359b8d3

XCode

  • Install XCode from App Store.
  • Open XCode and agree to terms and conditions.

XCode CLI Tools

  • xcode-select --install

Install Homebrew

View static_server.js
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
View .vimrc
set nocompatible " 去掉兼容性, 使用新的 vim 的功能
set t_Co=256
colorscheme xoria256
set guifont=menlo\ for\ powerline:h16
set guioptions-=T " Removes top toolbar
set guioptions-=r " Removes right hand scroll bar
set go-=L " Removes left hand scroll bar
set linespace=15
View gist:7277121
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
View gist:7193504
中文输入法:
我用的是QQ五笔,但在编辑模式中输入中文时,常常会触发MacVim的命令,原因是输是输入法没有完全截获按键;
解决方法:在命令行输入以下命令,
defaults write org.vim.MacVim MMUseInlineIm 0
View gist:7169760
git clone https://github.com/fivesheep/chnroutes.git
python chnroutes.py -p mac
sudo cp ip-up /etc/ppp
sudo cp ip-down /etc/ppp
sudo chmod a+x ip-up ip-down
@summerblue
summerblue / gist:7130165
Created Oct 24, 2013
checkout all the remote branches
View gist:7130165
for remote in `git branch -r `; do git branch --track $remote; done
git remote update
git pull --all
@summerblue
summerblue / gist:7128586
Last active Dec 26, 2015
命令行上的 Git, DEMO 初始化 git , 以及 branching
View gist:7128586

命令行上的 Git, DEMO 初始化 git , 以及 branching

创建 blog 项目, 并初始化 git

# 创建项目, 会在当前目录下创建 blog 文件夹
composer create-project laravel/laravel blog

# 进入项目文件夹
cd blog 
You can’t perform that action at this time.