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 build_table(element, object) { | |
| var i; | |
| for (i in object) { | |
| $(element).append("<tr><td>"+i+"</td><td>"+object[i]+"</td></tr>"); | |
| } | |
| } | |
| build_table("#sam", { | |
| foo: "bar", | |
| baz: "fizz" |
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 Graph(width, length) { | |
| this.width = width; | |
| this.length = length; | |
| this.elements = 2; // I want to keep this | |
| this.nodes = new Array(width * length); | |
| var i; | |
| for (i = 0; i < this.nodes.length; i += 1) { | |
| this.nodes[i] = new Node(this, i); | |
| } |
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
| x = .4375 * (16 + x) | |
| x = 7 + .4375x | |
| x / .4375 = 16 + x | |
| x - x / .4375 = 16 | |
| 0 / .4375 = 16 | |
| 0 = 7 | |
| math mother fuckers |
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 (very, good, parameters) { | |
| // Line up our variables | |
| var foo, | |
| string_var= "lol", | |
| bar, | |
| object = new Constructor(); | |
| // Four space indent | |
| if (condition) { |
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
| Item -> Attributes | |
| ---------------------- | |
| item_id | attribute_id | |
| 1 5 | |
| 1 8 | |
| Item Attributes | |
| ----------------------------- | |
| attribute_id | human_readable | |
| 5 Wood Floors |
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 () { | |
| // Blah blah useless comment | |
| COAD | |
| } | |
| function () { | |
| // Informative post, you can tell by the extra linebreak ^ | |
| elegant coad |
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 Graph(w, l, h) { | |
| this.w = w; | |
| this.l = l; | |
| this.h = h || 1; | |
| this.nodes = []; | |
| } | |
| Graph.prototype.toVec2 = function (i) { | |
| return new Vec2(i % this.w, Math.floor(i / this.w), 0 /* ??? */ ); | |
| }; |
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
| if ((m % i == 0) && (i == 20) && (i != 0)) { | |
| printf("%d", m); | |
| break; | |
| } else { | |
| m++; | |
| i = 0; | |
| } |
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
| Graph.prototype.toVector = function (i) { | |
| return new Vector(i % this.w, Math.floor(i / this.w), /* ??? */); | |
| }; |
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
| Graph.inBounds = function (G, x) { | |
| var vec = x.vector; | |
| return (vec.x < G.w && vec.x >= 0 && vec.y < G.h && vec.y >= 0); | |
| }; |
NewerOlder