Nick Shek's Blog

把現有的project folder變為git repository

首先,在localhost建立一個假project

cd ~/
mkdir project1
cd project1/
echo "HelloWorld!" >> test.txt

驗證是否確實將Hello World 寫入test.txt

cat test.txt

建立git repository

git init

在remote host 建立bare repository,以下的blog詳細解釋了什麼是bare git repository

http://www.saintsjd.com/2011/01/what-is-a-bare-git-repository/

cd ~/
mkdir project1.git
cd project1.git/
git init --bare

在localhost,

cd ~/project1

新增remote origin url

git remote add origin ssh://<username>@<ip address>/<path to bare repo>/project1.git

萬一新增的url 有錯,可以透過下列指令更新remote origin url

git remote set-url origin <url>

最后,輸入我們最熟悉的git指令

git push origin master

令你的youtube embed code變為responsive

把youtube的Embed HTML由

<iframe src="//www.youtube.com/embed/AsHKOH03mxw" frameborder="0" height="315" width="560"></iframe>

改成

<div class="video-container">
  <iframe src="//www.youtube.com/embed/AsHKOH03mxw" frameborder="0" height="315" width="560"></iframe>
</div>

之後加入以下CSS

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    padding-top: 30px; height: 0; overflow: hidden;
}

.video-container iframe,
.video-container object,
.video-container embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}