add the English post template using the Disqus service

This commit is contained in:
Jim
2014-02-03 20:44:59 +08:00
parent 9a0c4c1a93
commit 11d105c0c1
5 changed files with 290 additions and 1 deletions
+20
View File
@@ -0,0 +1,20 @@
<section class="comment">
<!-- Disqus Comment BEGIN -->
<div id="disqus_thread"></div>
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'dashjim'; // required: replace example with your forum shortname
/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<!--a href="http://disqus.com" class="dsq-brlink">comments powered by <span class="logo-disqus">Disqus</span></a-->
<!-- Disqus Comment END -->
</section>
+119
View File
@@ -0,0 +1,119 @@
---
layout: default
---
<section class="post">
{{ content }}
</section>
<section class="meta">
<span class="author">
<a href="http://blog.sevenche.com">{{ site.author }}</a>
</span>
<span class="time">
/
<time datetime="{{ page.date | date:"%Y-%m-%d" }}">{{ page.date | date:"%Y-%m-%d" }}</time>
</span>
<br />
<span class="license">
Published under <a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/3.0/">(CC) BY-NC-SA</a>
</span>
{% if page.categories %}
<span class="categories">
in categories
{% for cat in page.categories %}
<a href="/categories/#{{ cat }}" title="{{ cat }}">{{ cat }}</a>&nbsp;
{% endfor %}
</span>
{% endif %}
{% if page.tags %}
<span class="tags">
tagged with
{% for tag in page.tags %}
<a href="/tags/#{{ tag }}" title="{{ tag }}">{{ tag }}</a>&nbsp;
{% endfor %}
</span>
{% endif %}
</section>
{% include comments_en.md %}
<script type="text/javascript">
$(function(){
$(document).keydown(function(e) {
var url = false;
if (e.which == 37 || e.which == 74) { // Left arrow and J
{% if page.previous %}
url = '{{ site.url }}{{ page.previous.url }}';
{% endif %}
}
else if (e.which == 39 || e.which == 75) { // Right arrow and K
{% if page.next %}
url = '{{ site.url }}{{ page.next.url }}';
{% endif %}
}
if (url) {
window.location = url;
}
});
})
</script>
<style type="text/css">
/*resize the big pic*/
div.resized_image p {
margin: 2px;
margin-top: 0;
font-size: 8px;
/* Awesome icon from here: http://www.famfamfam.com/lab/icons/silk/ */
background: url(http://i242.photobucket.com/albums/ff244/9861_omikron/error.png) no-repeat;
padding-left: 20px;
color: #333;
}
</style>
<script type="text/javascript">
//resize the big pic
$(window).load(function() {
(
function(maxht, maxwt, minht, minwt) {
var imgs = document.getElementsByTagName('img');
// Image resizing function
var resize_image = function(img, newht, newwt) {
img.height = newht;
img.width = newwt;
$(img).wrap('<table><tr><td class="tborder"><div class="resized_image"><a href="' + img.src + '" target="_blank"></a></div></td></tr></table>');
$(img).parent().before('<p>NOTE: This image was resized. To view it full-size, click on the image.</p>');
//$(img).parent().after('<p style="text-align:right;background:none;margin:0;padding-right:3px">Image resizing script by <a href="http://aetus.net/217/programming/automatically-resize-large-images-with-javascript/">Aetus Designs</a>.</p>');
};
for (var i = 0; i < imgs.length; i++) {
// Set a variable for the current image to make the code make more sense.
var img = imgs[i];
if (img.height > maxht || img.width > maxwt) {
// Use Ratios to constraint proportions.
var old_ratio = img.height / img.width;
var min_ratio = minht / minwt;
// If it can scale perfectly.
if (old_ratio === min_ratio) {
resize_image(img, minht, minwt);
}
// We need to do some magic now.
else {
var newdim = [img.height, img.width];
// Sort out the height first.
newdim[0] = minht;
// The logic behind this is that if ratio = ht / wt, then wt = ht / ratio.
newdim[1] = newdim[0] / old_ratio;
// Do we still have to sort out the width?
if (newdim[1] > maxwt) {
// Just do what we did with the height
newdim[1] = minwt;
newdim[0] = newdim[1] * old_ratio;
}
// So yeah, resize the image
resize_image(img, newdim[0], newdim[1]);
}
}
}
}
)(780, 780, 780, 780);
});
</script>
+1 -1
View File
@@ -7,7 +7,7 @@ layout: default
</section>
<section class="meta">
<span class="author">
<a href="http://geeklu.com">{{ site.author }}</a>
<a href="http://blog.sevenche.com">{{ site.author }}</a>
</span>
<span class="time">
/
@@ -30,6 +30,7 @@ tags:
###更多测试的结果
下面的对比测试中我们对比一下不同丢包情况所导致的不同TCP吞吐率曲线。(前面一个小峰是带宽测试留下的。)
下图是视频质量好的时候的TCP呑吐率情况
![](/media/pic2014/0201-4.png)
下图是视频时断时续丟包
+149
View File
@@ -0,0 +1,149 @@
---
layout: post-en
title: Git Cook Book
categories:
- Common Tec
tags:
- Git
---
> 本文始于自己Evernote,由于大部分原本是英文记录的,所以干脆全部用英文。
> Most of the content comes from my Evernote, therefore, this post will be updated once I have more on my note and your contribution is highly appropriated.
----------
### How to see simple git log?
-------------
```
git log --oneline
git log --oneline --graph --decorate
git config --global alias.pl "log --oneline --graph --decorate"
git log --oneline -3
```
### How to see log in another branch?
-------------
```
git log origin/master..
```
### How to search keywords in commit comment (across all branches)?
-------------
If you want to know how a feature was implemented, you can start by search the keywords in the log history.
`--grep` can bring you the entire commit message instead of ONE line which contains the keywords
```
git log --all --grep='a keyword'
```
### How to see history of one file?
-------------
```
git log -- [filename] (show the log history)
git log -p filename (git generate the patches for each log entry)
gitk [filename] (Show the content changed)
git log --follow <filename> (Show rename)
```
### How to only produce one commit for a merge?
> Usually all local commit history will be merged to the target branch. Below command only produce a new commit for the merge.
```
git merge --squash bugfix
git commit -m 'fix bug'
```
### How to only see local commit log?
```
git log --no-merges master..
```
### How to revert to a commit?
```
git reset --hard 4a155e5
and then
git push -f origin master
```
**Notice: git revert will not work here!**
### How to find a lost commit?
--------------
> As a last resort in case your commit is dangling and not connected to history at all, you can search the reflog itself with the `-g` flag (short for `--walk-reflogs`)
```
git log -g --grep='Build 0051'
```
**Be aware that the reflog only contains the local history.**
### How to know which branch is the most recent?
--------------------
> Sort the branches by commit time.
```
git config --global alias.latest "for-each-ref --sort=-committerdate --format='%(committerdate:short) %(refname:short)'"
```
**Usage:**
```
$ cd ~/Code/rails/rails && git latest
2012-11-19 origin/master
2012-11-19 origin/HEAD
2012-11-19 master
2012-11-19 origin/3-2-stable
2012-11-03 origin/encrypted_cookies
2012-11-03 origin/attributes_perf
... snipped ...
```
**Show local branches only:**
```
git config --global alias.latest "for-each-ref --sort=-committerdate refs/heads --format='%(committerdate:short) %(refname:short)'"
```
### How to change the remote HEAD
------------
```
git branch -a
remotes/origin/HEAD -> origin/gh-pages
remotes/origin/gh-pages
remotes/origin/master
git remote set-head origin master
git branch -a
remotes/origin/HEAD -> origin/master
remotes/origin/gh-pages
remotes/origin/master
```
### How to delete a remote git branch?
-------------
```
git push origin --delete <branchName>
```
### How to delete the merge orig file?
-------------
```
git clean -f
```
But beware... there's no going back. Use -n or --dry-run to preview the damage you'll do.
`git-clean` Remove untracked files from the working tree
If you want to also remove directories, run `git clean -f -d`
If you just want to remove ignored files, run `git clean -f -X`
If you want to remove ignored as well as non-ignored files, run `git clean -f -x`
Note the case difference on the X for the two latter commands.
### How to know the remote branch names?
-------------
```
git branch -r
```
### How to rename a file?
```
$ git mv README README.md
$ git commit -m "renamed"
$ git push origin master
```
### How to pull a remote branch?
-------------
Before you can start working locally on a remote branch, you need to fetch it as called out in answers below.
To fetch a branch, you simply need to:
```
git fetch origin
git branch -r
```
This will fetch all of the remote branches for you. With the remote branches in hand, you now need to check out the branch you are interested in, giving you a local working copy:
```
git checkout -b test origin/test
```