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
// Code me, yo! |
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
// knowing three things is essential for JavaScript OOP | |
// --- | |
// #1 the concept of "closures" (and functional scoping in general) | |
// #2 knowing how the keyword "this" works, and how to use it. | |
// #3 knowing when to use the keyword "new" | |
// example of an OOP style JavaScript class implementation | |
var ProtoClass = (function(){ | |
// these would be your "private" variables, (in the sense that it can no longer be modified from the outside) | |
// if you send any of this stuff to the client, its clearly visible with any decent browser Developer Tools |
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
beautify: (string, indent = 0) -> | |
switch ch = string[0] || '' | |
when '' then "" | |
when '{' or '[' then "#{ch}\n#{Array(++indent+1).join('\t')}#{@beautify(string[1..], indent)}" | |
when '}' or ']' then "\n#{Array(--indent+1).join('\t')}#{ch}#{@beautify(string[1..], indent)}" | |
when ',' then "#{ch}\n#{Array(indent+1).join('\t')}#{@beautify(string[1..], indent)}" | |
when ':' then " : #{@beautify(string[1..], indent)}" | |
else "#{ch}#{@beautify(string[1..], indent)}" |
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
using UnityEngine; | |
using System; | |
using System.Collections; | |
public class BackgroundPlane : MonoBehaviour { | |
static BackgroundPlane _this; | |
public Color topLeftColor, topRightColor, btmRightColor, btmLeftColor; |
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
void spread(Transform area, ref GameObject[] array) { | |
int l = array.Length; | |
if (l > 1) { | |
Vector3 center = area.collider.bounds.center, extents = area.collider.bounds.extents; | |
float top = center.y + extents.y, | |
bottom = center.y - extents.y; | |
bool allSpread; | |
int tries = 0, maxTries = 5000; | |
float bumpDist = 1.5f; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<p>Hello World</p> | |
</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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title>w | |
</head> | |
<body> | |
</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
/* | |
app = express() | |
db = a mongodb with the collection "users" | |
*/ | |
app.get('/user/:name', function (req, res) { | |
db.users.find({name: req.params.name}, function (theRecordThatYouAskedFor) { | |
res.render('mytemplatename', { myTemplateVariableThatHoldsUserInfo: theRecordThatYouAskedFor}) | |
}); |
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
ig.module( | |
'game.main' | |
).requires( | |
'impact.game' | |
'impact.font' | |
).defines -> | |
MyGame = ig.Game.extend | |
font: new ig.Font('media/04b03.font.png') | |
init: -> | |
# Initialize your game here; bind keys etc. |
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
table.andys-table { | |
thead tr { | |
font-weight: bold; | |
} | |
tbody { | |
tr { | |
border-right: 1px solid #ddd; | |
td:first-child { | |
font-weight: bold; |
NewerOlder