This file contains hidden or 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
| /* | |
| when you click on <a class="dt">Hello</a> and a | |
| <dt>Hello</dt> is on the same page, the page scrolls | |
| to that location. | |
| */ | |
| $(document).ready(function () { | |
| $('a.dt', document).each(function () { | |
| var that = $(this), rel = that.attr('href') || | |
| that.text().replace(/\s+/g, ' '); | |
| if (!rel) { |
This file contains hidden or 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
| var getAnyOneScript = function (scripts) { | |
| // TODO: http://stackoverflow.com/questions/2027849/how-to-trigger-script-onerror-in-internet-explorer/2032014#2032014 | |
| scripts = scripts instanceof Array ? scripts : [scripts]; | |
| var script = document.createElement('script'); | |
| script.setAttribute('type', 'text/javascript'); | |
| script.setAttribute('src', scripts[0]); | |
| script.onerror = function () { | |
| scripts.shift(); | |
| getAnyOneScript(scripts); |
This file contains hidden or 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
| /* http://javascript.crockford.com/code.html | |
| JavaScript code should not be embedded in HTML files unless | |
| the code is specific to a single session. | |
| */ | |
| // All variables should be declared before used. | |
| var sampleVar; // Avoid lines longer than 80 characters. | |
| var stupidFunction = function (param1, param2, param3, // There should be no space between the name of a function and the (, except If a function literal is anonymous |
This file contains hidden or 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
| #!/usr/bin/env python | |
| # PEP 20 supersedes PEP 8 http://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds | |
| # Follow PEP 20 if readability is affected by PEP 8 | |
| # max length 79 chars, not 80 (http://www.python.org/dev/peps/pep-0008/#maximum-line-length) | |
| """One-line summary of purpose. # double quoted docstrings; max length 72 chars (http://www.python.org/dev/peps/pep-0008/#maximum-line-length) | |
| # 2nd line must be blank http://www.python.org/dev/peps/pep-0257/#multi-line-docstrings | |
| More things # aligns with the quotes | |
| More things | |
| """ |
NewerOlder