Skip to content

Instantly share code, notes, and snippets.

@dj1020
dj1020 / .gitconfig
Created February 23, 2016 09:39
Git Alias Settings
[alias]
adda = add -A
al = add .
bl = branch -a
br = branch
ci = commit
cim = commit -m
cima = commit -a -m
ck = checkout
fa = fetch --all
#!/usr/bin/env bash
# Upgrade Base Packages
sudo apt-get update
sudo apt-get upgrade -y
# Install Web Packages
sudo apt-get install -y build-essential dkms re2c apache2 php5 php5-dev php-pear php5-xdebug php5-apcu php5-json php5-sqlite \
php5-mysql php5-pgsql php5-gd curl php5-curl memcached php5-memcached libmcrypt4 php5-mcrypt postgresql redis-server beanstalkd \
openssh-server git vim python2.7-dev
@dj1020
dj1020 / migrate.sh
Last active February 5, 2019 13:05 — forked from tobi-pb/migrate.sh
Upgrade MAMP to Mysql 5.7 tested by Ken Lin 2015/11/09
#!/bin/sh
wget http://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.9-osx10.10-x86_64.tar.gz
tar xfvz mysql-5.7*
echo "stopping mamp"
sudo /Applications/MAMP/bin/stop.sh
sudo killall httpd mysqld
echo "creating backup"
#!/bin/bash
for pkg in `dpkg --get-selections | egrep -v deinstall | awk '{print $1}' | egrep -v '(dpkg|apt|mysql|mythtv)'` ; do apt-get -y install --reinstall $pkg ; done
@dj1020
dj1020 / .vimrc.after
Last active August 29, 2015 14:27
Janus, Jeffrey way .vimrc.after file
set nocompatible " 關閉 vi 相容模式,不太確定做什麼用。和 u,及 insert mode 的方向鍵移動有關。
set t_Co=256
colorscheme xoria256
set guifont=Menlo: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
" set lines=25 加了之後 iTerm 會被設成 25 行 >"<
@dj1020
dj1020 / gulpfile.js
Created July 23, 2015 02:38
Gulp with PHPUnit simplest config file
var gulp = require('gulp'),
exec = require('child_process').exec,
sys = require('sys'),
util = require('util');
gulp.task('phpunit', function() {
exec('clear', function(error, stdout, stderr){
util.puts(stdout);
exec('phpunit', function(error, stdout) {
sys.puts(stdout);
var CompactCommand= function(){
var self = this;
this.start = new Date(); // measure running time
this.exec = function(){
printDbStats(); // before dbstats
execCommand();
printDbStats(); // after dbstats
}
this.calcExecTime = function(){
var end = new Date();
@dj1020
dj1020 / gulpfile.js
Last active August 29, 2015 14:20 — forked from mikeerickson/gulpfile.js
Gulp with Phpspec edited from Mike Erickson
/* Gulpfile
* Mike Erickson
*/
var gulp = require('gulp'),
notify = require('gulp-notify'),
phpspec = require('gulp-phpspec');
gulp.task('phpspec', function() {
var options = {
@dj1020
dj1020 / gulpfile.js
Created April 7, 2015 04:43
Run codeception test with gulp and automatically open report when test fails
var gulp = require('gulp');
var notify = require('gulp-notify');
var codecept = require('gulp-codeception');
var changed = require('gulp-changed');
var open = require('gulp-open');
var watch = require('gulp-watch');
var debug = require('gulp-debug');
var _ = require('lodash');
gulp.task('runtest', function() {
@dj1020
dj1020 / Gulpfile.js
Last active August 29, 2015 14:17
Gulpfile.js Example for codeception with notification
var gulp = require('gulp');
var notify = require('gulp-notify');
var codecept = require('gulp-codeception');
var _ = require('lodash');
gulp.task('runtest', function() {
var options = testCodeceptOptions('api', 'categoryProductApiCest');
gulp.src('codeception.yml')
.pipe(codecept('./vendor/bin/codecept', options))
.on('error', notify.onError(testNotification('fail', 'codeception')))