- max-age
- etag
- last_modified
git config --local credential.helper store
git config http.sslVerify false
git remote -v
git remote set-url origin https://..../example.git
# 取得遠端的branch並在本地端建立一個branch
git checkout --track -b feature_branch origin/feature_branch
sudo apt-get -y update
sudo apt-get install -y build-essential zlib1g-dev curl git-core sqlite3 libsqlite3-dev
sudo apt-get install -y libssl-dev libreadline-dev
git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
mkdir -p /Users/joshchang/Documents/vagrant_box
vagrant package --output /Users/joshchang/Documents/vagrant_box/mybox.box
vagrant box add mybox /Users/joshchang/Documents/vagrant_box/mybox.box
# New project
vagrant init mybox
vagrant up
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
<html> | |
<head> | |
<style type="text/css"> | |
ul li { | |
margin-bottom: 10px; | |
cursor: move; | |
} | |
</style> | |
</head> |
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
var logger = function () { | |
var oldDebug = null, | |
oldLog = null, | |
oldInfo = null, | |
oldWarn = null, | |
oldError = null; | |
return { | |
enable: function () { | |
if (oldLog === null) return; |
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
@include text-overflow; | |
@include text-shadow(0 -1px 1px #21272B); | |
@include border-radius(2px, 2px); | |
@include border-bottom-left-radius(8px); | |
@include box-shadow(rgba(0, 0, 0, 0.05) 3px 3px 5px); | |
@include single-box-shadow(rgba(0, 0, 0, 0.075), 0, 0, 3px); | |
@include single-transition(opacity, 0.2s, linear, 0s); | |
@include background(linear-gradient($color-btn, darken($color-btn, 10%))); | |
@include background-image(linear-gradient(lighten($color-btn, 5%), darken($color-btn, 15%))); | |
@include background-image(none); |
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
class ApplicationController < ActionController::Base | |
before_filter :mobile_view_redirect | |
layout :which_layout | |
def mobile_device? | |
request.user_agent =~ /Mobile|webOS|Android/ | |
end | |
helper_method :mobile_device? |
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
# 查foreign key | |
# login in mysql | |
mysql -u root -p | |
use information_schema; | |
select TABLE_NAME,COLUMN_NAME,CONSTRAINT_NAME, REFERENCED_TABLE_NAME,REFERENCED_COLUMN_NAME from KEY_COLUMN_USAGE where REFERENCED_TABLE_NAME = '<TABLE NAME>'; | |
# 列出wed_development的所有FK | |
SELECT i.TABLE_SCHEMA, i.TABLE_NAME, i.CONSTRAINT_TYPE, i.CONSTRAINT_NAME, k.REFERENCED_TABLE_NAME, k.REFERENCED_COLUMN_NAME | |
FROM information_schema.TABLE_CONSTRAINTS i | |
LEFT JOIN information_schema.KEY_COLUMN_USAGE k ON i.CONSTRAINT_NAME = k.CONSTRAINT_NAME |
NewerOlder