This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 用 Closure 取得 Class Private Property | |
// | |
// ref: https://ocramius.github.io/blog/accessing-private-php-class-members-without-reflection/ | |
// 比用 reflection 快很多 | |
class Example { | |
private $myName; | |
public function __construct($name) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
DocumentRoot "/Users/myName/Projects/laravel/public" | |
ServerName myLaravel.dev | |
<Directory "/Users/myName/Projects/laravel/public"> | |
AllowOverride All | |
Options FollowSymLinks +Indexes | |
Order allow,deny | |
Allow from all | |
</Directory> | |
</VirtualHost> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Minitest; | |
abstract class AbstractFoo | |
{ | |
protected function bar() | |
{ | |
return $this->baz(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getRepoUrl() { | |
local name='origin' | |
local gitUrl | |
local repoUrl | |
if [ ! -z "$1" ]; then | |
name="$1" | |
fi | |
gitUrl=`git remote get-url $name` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>info.mamp.start.apache</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Applications/MAMP/Library/bin/apachectl</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" | |
"http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>info.mamp.start.mysql</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/Applications/MAMP/Library/bin/mysqld_safe</string> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
tm() { | |
if [ -z $1 ]; then | |
tmux switch-client -l | |
else | |
if [ -z "$TMUX" ]; then | |
tmux new-session -As $1 | |
else | |
if ! tmux has-session -t $1 2>/dev/null; then | |
TMUX= tmux new-session -ds $1 |