Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add some stuff that I've been meaning to add for a long while...
- Loading branch information
Hong
committed
May 22, 2011
1 parent
8eea614
commit 8588ce9
Showing
16 changed files
with
582 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
BUNDLE_DISABLE_SHARED_GEMS: "1" | ||
--- {} | ||
|
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
General Formatting and Syntax | ||
===================== | ||
|
||
Don't really have a quick description right now, however, I recommend you learn how to utilize asynchronous events. | ||
|
||
* Still in progress will update when I have time * | ||
|
||
Formatting | ||
--------------- | ||
|
||
|
||
Syntax and Usage | ||
------------------------ | ||
|
||
* Avoid inline Javascript when possible. Hook to events using whatever Javascript framework you're using. | ||
|
||
However, having script tags in your html templates is fine. Just don't do an inline on[*event] hook. | ||
|
||
|
||
* Remember that returning false on a jQuery callback is not the same as returning false on an inline callback. | ||
|
||
The main difference is that return false; on a jQuery callback executes event.preventDefault() and | ||
event.stopPropagation() as well as returns out of the function. Returning false on an inline callback only | ||
prevents the default. | ||
|
||
|
||
* Use event.preventDefault() or event.stopPropagation() if you only need one of it. | ||
|
||
event.preventDefault() stops whatever the default behavior of the element from executing (eg an anchor | ||
redirecting). event.stopPropagation() stops event bubbling up into the parent elements. | ||
|
||
|
||
Common Sense | ||
-------------------- | ||
|
||
* Don't cram everything into one big javascript file if only certain pages require it. | ||
|
||
Especially true if those certain pages are rarely accessed. | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>File: Git</title> | ||
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" /> | ||
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" /> | ||
|
||
<script type="text/javascript" charset="utf-8"> | ||
relpath = ''; | ||
if (relpath != '') relpath += '/'; | ||
</script> | ||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script> | ||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script> | ||
|
||
</head> | ||
<body> | ||
<script type="text/javascript" charset="utf-8"> | ||
if (window.top.frames.main) document.body.className = 'frames'; | ||
</script> | ||
|
||
<div id="header"> | ||
<div id="menu"> | ||
|
||
<a href="_index.html" title="Index">Index</a> » | ||
<span class="title">File: Git</span> | ||
|
||
|
||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> | ||
</div> | ||
|
||
<div id="search"> | ||
<a id="class_list_link" href="#">Class List</a> | ||
<a id="method_list_link" href="#">Method List</a> | ||
<a id ="file_list_link" href="#">File List</a> | ||
</div> | ||
|
||
<div class="clear"></div> | ||
</div> | ||
|
||
<iframe id="search_frame"></iframe> | ||
|
||
<div id="content"><div id='filecontents'><h1>General Rules</h1> | ||
|
||
<ul> | ||
<li>Do not commit code without green tests</li> | ||
<li>Your commit message should be explicit and consistent with your committing code</li> | ||
<li>Remember MEMO: Merge Early, Merge Often</li> | ||
</ul> | ||
|
||
|
||
<h2>Where's the Remote?</h2> | ||
|
||
<ul> | ||
<li><p>Do not rewrite history on anything that has been pushed to a remote--even if it's not on the master branch.</p> | ||
|
||
<p> In particular, I'm speaking about the <code>git commit --amend/--squash</code> and <code>git rebase</code> commands. People | ||
might have already fetched it and maybe even merged it to another of their local branches. Those people | ||
might not know commit X was supposed to have been changed somehow, and when they pull again, it'll | ||
either be a broken commit or end up reverting whatever change was made.</p></li> | ||
</ul> | ||
|
||
|
||
<h2>Good Defaults</h2> | ||
|
||
<ul> | ||
<li><p>Default entries for .gitignore</p> | ||
|
||
<pre class="code"> <span class='mult op'>*</span><span class='dot token'>.</span><span class='DS_Store constant id'>DS_Store</span> | ||
<span class='mult op'>*</span><span class='bitnot op'>~</span> | ||
<span class='dot token'>.</span><span class='rvmrc identifier id'>rvmrc</span> | ||
<span class='dot token'>.</span><span class='bundle identifier id'>bundle</span> | ||
<span class='Session constant id'>Session</span><span class='dot token'>.</span><span class='vim identifier id'>vim</span> | ||
<span class='mult op'>*</span><span class='dot token'>.</span><span class='swp identifier id'>swp</span> | ||
</pre></li> | ||
<li><p>Default entries for .gitignore for Rails</p> | ||
|
||
<pre class="code"> <span class='config identifier id'>config</span><span class='div op'>/</span><span class='database identifier id'>database</span><span class='dot token'>.</span><span class='yml identifier id'>yml</span> | ||
<span class='log identifier id'>log</span><span class='div op'>/</span> | ||
<span class='tmp identifier id'>tmp</span><span class='div op'>/</span> | ||
<span class='coverage identifier id'>coverage</span><span class='div op'>/</span> | ||
<span class='db identifier id'>db</span><span class='div op'>/</span><span class='mult op'>*</span><span class='dot token'>.</span><span class='db identifier id'>db</span> | ||
<span class='db identifier id'>db</span><span class='div op'>/</span><span class='mult op'>*</span><span class='dot token'>.</span><span class='sqlite3 identifier id'>sqlite3</span> | ||
<span class='public identifier id'>public</span><span class='div op'>/</span><span class='system identifier id'>system</span><span class='div op'>/</span> | ||
</pre></li> | ||
</ul> | ||
</div></div> | ||
|
||
<div id="footer"> | ||
Generated on Sun May 22 00:23:30 2011 by | ||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> | ||
0.6.5 (ruby-1.8.7). | ||
</div> | ||
|
||
</body> | ||
</html> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | ||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<title>File: Javascript</title> | ||
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" /> | ||
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" /> | ||
|
||
<script type="text/javascript" charset="utf-8"> | ||
relpath = ''; | ||
if (relpath != '') relpath += '/'; | ||
</script> | ||
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script> | ||
<script type="text/javascript" charset="utf-8" src="js/app.js"></script> | ||
|
||
</head> | ||
<body> | ||
<script type="text/javascript" charset="utf-8"> | ||
if (window.top.frames.main) document.body.className = 'frames'; | ||
</script> | ||
|
||
<div id="header"> | ||
<div id="menu"> | ||
|
||
<a href="_index.html" title="Index">Index</a> » | ||
<span class="title">File: Javascript</span> | ||
|
||
|
||
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div> | ||
</div> | ||
|
||
<div id="search"> | ||
<a id="class_list_link" href="#">Class List</a> | ||
<a id="method_list_link" href="#">Method List</a> | ||
<a id ="file_list_link" href="#">File List</a> | ||
</div> | ||
|
||
<div class="clear"></div> | ||
</div> | ||
|
||
<iframe id="search_frame"></iframe> | ||
|
||
<div id="content"><div id='filecontents'><h1>General Formatting and Syntax</h1> | ||
|
||
<p>Don't really have a quick description right now, however, I recommend you learn how to utilize asynchronous events.</p> | ||
|
||
<ul> | ||
<li>Still in progress will update when I have time *</li> | ||
</ul> | ||
|
||
|
||
<h2>Formatting</h2> | ||
|
||
<h2>Syntax and Usage</h2> | ||
|
||
<ul> | ||
<li><p>Avoid inline Javascript when possible. Hook to events using whatever Javascript framework you're using.</p> | ||
|
||
<p> However, having script tags in your html templates is fine. Just don't do an inline on[*event] hook.</p></li> | ||
<li><p>Remember that returning false on a jQuery callback is not the same as returning false on an inline callback.</p> | ||
|
||
<p> The main difference is that return false; on a jQuery callback executes event.preventDefault() and | ||
event.stopPropagation() as well as returns out of the function. Returning false on an inline callback only | ||
prevents the default.</p></li> | ||
<li><p>Use event.preventDefault() or event.stopPropagation() if you only need one of it.</p> | ||
|
||
<p> event.preventDefault() stops whatever the default behavior of the element from executing (eg an anchor | ||
redirecting). event.stopPropagation() stops event bubbling up into the parent elements.</p></li> | ||
</ul> | ||
|
||
|
||
<h2>Common Sense</h2> | ||
|
||
<ul> | ||
<li><p>Don't cram everything into one big javascript file if only certain pages require it.</p> | ||
|
||
<p> Especially true if those certain pages are rarely accessed.</p></li> | ||
</ul> | ||
</div></div> | ||
|
||
<div id="footer"> | ||
Generated on Sun May 22 00:23:30 2011 by | ||
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a> | ||
0.6.5 (ruby-1.8.7). | ||
</div> | ||
|
||
</body> | ||
</html> |
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
Oops, something went wrong.