
食材
- 里肌肉
- 鳳梨罐頭兩片
- 半片青椒
- 半根紅蘿蔔
- 洋蔥 1/6
- 番茄 1/2
調味料
- 蔥一條
- 薑末
- 蒜末
- 醬油膏一大匙
- 番茄醬五大匙
- 蛋
- 醬油
- 糖
- 鹽
作法
- 里肌肉切厚片
- 使用太白粉、胡椒、水、米酒、醬油、蛋黃抓肉醃漬
- 下油鍋炸酥約七分熟
- 薑末、蒜末、蔥段爆香
- 倒入里肌肉後,放入番茄、洋蔥、鳳梨
- 加入水、醬油膏、番茄醬,少許糖,少許鹽
- 收汁的差不多最後再加青椒拌勻後起鍋

這個 plugin 可以初始擁有 YouTube 或 Vimeo 的超連結點選之後將自己或指定的目標轉換成影片。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Video</title>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="js/jquery.video_creator.js"></script>
<script>
$(function() {
$('a').video_creator({
width: 200,
height: 100,
target: '#video'
});
});
</script>
</head>
<body>
<a href="https://www.youtube.com/watch?v=p6oaqY6flJg">Youtube</a>
<a href="http://vimeo.com/89495751">Vimeo</a>
<div id="video"></div>
</body>
</html>
(function() {
$.fn.video_creator = function(options) {
var params = {
width: 640,
height: 360,
target: ''
}
var set = $.fn.extend(params, options);
return this.each(function() {
var url = $(this).prop('href'),
id = '',
matches = '',
result = '';
// Youtube
if (-1 !== url.toLowerCase().indexOf('youtube')) {
matches = url.match(/[\\?\\&]v=([^\\?\\&]+)/);
id = matches[1];
result = '<iframe width="' + set.width + '" height="' + set.height + '" src="//www.youtube.com/embed/' + id + '" frameborder="0" allowfullscreen></iframe>';
}
// Vimeo
if (-1 !== url.toLowerCase().indexOf('vimeo')) {
matches = url.match(/\/\/(www\.)?vimeo.com\/(\d+)($|\/)/);
id = matches[2];
result = '<iframe src="http://player.vimeo.com/video/' + id + '?title=0&byline=0&portrait=0&badge=0&color=ffffff" width="' + set.width + '" height="' + set.height + '" frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>';
}
$(this).on('click', function() {
if ('' === set.target) {
$(this).replaceWith(result);
} else {
$(set.target).html(result);
}
return false;
});
});
}
}(jQuery));
在使用 vim 的時候常常會不小心讓狀態列出縣 recording 的字樣,按 q 可以消除,今天不小心看到某篇文章才發現這是 vim 的 macro 功能,而且十分強大,vim 真的是一個可以活到老學到老的工具,來示範幾個範例。
.sample {
border: 1px; color: red; padding: 4px; margin: 10px;
}
以這個 css class 來講,假設我們要讓每個 ; 後斷行,有非常非常多的方式,marco 的步驟如下
qa(qa 是指將過程錄到 a 這個暫存,a-z, 0-9 都可以使用)f;,此時游標會跑到 ; 上面a,游標會跑到 ; 後面並且變成 insert modeenter,完成了第一個斷行esc 變成 visual mode,在按一次 q 完成錄製
.sample {
border: 1px;
color: red; padding: 4px; margin: 10px;
}
現在內容應該會變成這個樣子
將滑鼠移到 color 那行按下 @a(@ 就是執行 macro,後面接要使用的紀錄),斷行自動產生了,如果要到每一行按 @a 也太弱了,可以在前面接數字指定 marco 次數,以這個 case 來說 3@a 就可以完成所有的斷行。
另外示範一個 increment 的範例,在 vim 中使用 ctrl + a 可以針對某個數字增量,ctrl + x 可以減量,但在 windows 裡面 ctrl + a 會被定義為全選,關掉的方式很簡單,打開 .vimrc 檔,在 behave mswin 下加上 :nunmap <C-a>,這樣便會取消全選功能。
a = 1
以這個例子當範例,可以選擇取代法,也可以用 macro
qayy 複製,按下 p 貼上ctrl + a,會發現數字變成 2 了q 完成錄製按下 @a 可以發現新的行數會變成 a = 3,搭配數字便可以做出你需要的數量了。