Start to use Git & Dropbox
It’s really great to use Git to manage my source code. So that , I can develop my own application anywhere , manage my source code offline , and push it when I need to. Here is a memo for the most simple way to implement it.
1. Install Git & Dropbox
Git : http://code.google.com/p/msysgit/downloads/list
Dropbox: https://www.dropbox.com
2. Create a folder for placing the repository in Dropbox folder
C:\Users\shenhengbin\Dropbox\Repos
3. I have a project below want to add to Git
C:\shenhb\dev\proj\DataAnalysisWeb
4. In the DataAnalysisWeb folder , input the command below with Git Bash
git init
5. Clone one copy into the Repos under the Dropbox folder
git clone –bare . C:\Users\shenhengbin\Dropbox\Repos\DataAnalysisWeb.git
6. Create a remote repository named “origin” point at the above folder .Then , I can use push&pull from it.
git remote add origin C:\Users\shenhengbin\Dropbox\Repos\DataAnalysisWeb.git
7. OK , Then I can use push like
git push origin master
8. Finally , If other one also want to checkout it , I can share the folder to him , and use
git clone C:\XXXXXXX\Dropbox\Repos\DataAnalysisWeb.git
to get the latest source code from Dropbox.
Create css of resizing iframe content
var s = [];
s.push("zoom: 0.2");
s.push("-moz-transform: scale(0.2, 0.2)");
s.push("-webkit-transform: scale(0.2, 0.2)");
s.push("-o-transform: scale(0.2, 0.2)");
s.push("-ms-transform: scale(0.2, 0.2)");
s.push("transform: scale(0.2, 0.2)");
s.push("-moz-transform-origin: top left");
s.push("-webkit-transform-origin: top left");
s.push("-o-transform-origin: top left");
s.push("-ms-transform-origin: top left");
s.push("transform-origin: top left");
var css = s.join(";");
JQuery get size of iframe content
It does not works for the cross-domain, but works fine in same domain .
$('iframe').load(function () {
var doc = this.contentWindow.document;
var height = Math.max(
doc.body.scrollHeight || 0,
doc.documentElement.scrollHeight || 0,
doc.body.offsetHeight || 0,
doc.documentElement.offsetHeight || 0,
doc.body.clientHeight || 0,
doc.documentElement.clientHeight || 0
);
var width = Math.max(
doc.body.scrollWidth || 0,
doc.documentElement.scrollWidth || 0,
doc.body.offsetWidth || 0,
doc.documentElement.offsetWidth || 0,
doc.body.clientWidth || 0,
doc.documentElement.clientWidth || 0
);
};
jQueryMobile excute javascript code twice
I have came across a problem while I putting some JavaScript code inside the HTML body it was excuted twice .
<body>
<script language="javascript">
$(document).ready(function() {
alert("1");
});
</script>
</body>
And if I move the JavaScript code within <head> section, it will solve the issue.
Redundant div tag added just before the close body tag on Galaxy S3
I found a problem that sometimes there is a “FALSE” character displayed at the end of our web page on Galaxy S3 Phone.
With further research , a div tag <div id = “recog_div”>False</div> be founded just before the close body tag.
It seems to be added by Galaxy itself ?
So , I have to remove it by redundant source code. 😦
