Skip to content

Instantly share code, notes, and snippets.

View anderoonies's full-sized avatar

Andy Bayer anderoonies

View GitHub Profile
const lightDungeon = ({ dungeon, colors }) => {
// initialize an empty light map, which is mutated in `paintLight`
let lightMap = gridFromDimensions(HEIGHT, WIDTH, undefined);
for (let row = 0; row < HEIGHT; row++) {
for (let col = 0; col < WIDTH; col++) {
// if a cell is a light source, calculate the light data
// it creates and store it in `lightMap`
if (dungeon[row][col].glowLight) {
lightMap = paintLight({
lightSource: dungeon[row][col].glowLight,
class CourseStudentsJoin(models.Model):
"""Creates a mock of the previous many to many join."""
class Meta:
db_table = u'course_course_students'
course = models.ForeignKey(Course)
student = models.ForeignKey(User)
$('#email-form').on('submit', function(event){
event.preventDefault();
console.log("form submitted!") // sanity check
submit_email();
});