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
| $ chmod 700 /home/hub/.ssh |
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
| {% extends "base_generic.html" %} | |
| {% block title %}{{ section.title }}{% endblock %} | |
| {% block content %} | |
| <h1>{{ section.title }}</h1> | |
| {% for story in story_list %} | |
| <h2> | |
| <a href="{{ story.get_absolute_url }}"> |
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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Scale Graph</title> | |
| </head> | |
| <body> | |
| <div id="demoContainer"> | |
| <div id="option"> | |
| <input name="updateButton" type="button" value="Update"/> | |
| </div> |
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
| <!DOCTYPE HTML> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> | |
| <title>JavaScript 101</title> | |
| <script type="text/javascript"> | |
| function load() | |
| { | |
| function forEach(array, action) { |
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
| e.cancelBubble = true; | |
| if (e.stopPropagation) { | |
| e.stopPropagation(); | |
| } |
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
| // from Douglas Crockford's video 'An Incovenient API - The Theory of the DOM' | |
| // http://video.yahoo.com/watch/111582/992708 | |
| function walkTheDOM(node, func) { | |
| func(node); | |
| node = node.firstChild; | |
| while (node) { | |
| walkTheDOM(node, func); | |
| node = node.nextSibling; | |
| } | |
| } |
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
| function forEach(array, action) { | |
| var i; | |
| for (i = 0; i < array.length; i++) { | |
| action(array[i]); | |
| } | |
| } | |
| function reduce(combine, base, array) { | |
| forEach(array, function (element) { | |
| base = combine(base, element); |
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
| function forEach(array, action) { | |
| for (var i = 0; i < array.length; i++) | |
| action(array[i]); | |
| } | |
| function reduce(combine, base, array) { | |
| forEach(array, function (element) { | |
| base = combine(base, element); | |
| }); | |
| return base; |
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 cat = {}; // a 'set' of names | |
| cat['Red Lion'] = {'colour': 'grey', 'size': 46}; // a name is added to this set | |
| cat['Doctor Hobbles'] = {'colour': 'white', 'size': 15}; | |
| cat['Little Iroquois'] = {'colour': 'yellow', 'size': 30}; | |
| delete cat['Doctor Hobbles']; // a name is removed from this set | |
| if ('Red Lion' in cat) { // check whether a name occurs in this set. | |
| alert('you have "Red Lion" cat.'); | |
| } |
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
| function absolute(number) { | |
| if (number < 0) | |
| return -number; | |
| return number; | |
| } |
NewerOlder