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
a = 1 | |
def foo(): | |
print(a) # Prints 1. Accesses the variable a outside its own scope. | |
foo() | |
print(a) # Prints 1. a not modified. | |
b = 2 | |
def bar(): |
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
var fs = require('fs'); | |
var data = JSON.parse(fs.readFileSync('modules.json')); | |
var lessonTypes = ['DESIGN LECTURE', 'LABORATORY', 'LECTURE', 'PACKAGED LECTURE', | |
'PACKAGED TUTORIAL', 'RECITATION', 'SECTIONAL TEACHING', | |
'SEMINAR-STYLE MODULE CLASS', 'TUTORIAL', 'TUTORIAL TYPE 2', | |
'TUTORIAL TYPE 3']; | |
var weeks = ['EVERY WEEK', 'ODD WEEKS', 'EVEN WEEKS']; | |
var days = ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY']; |
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
def scope_test(): | |
def do_local(): | |
spam = "local spam" | |
def do_nonlocal(): | |
nonlocal spam | |
spam = "nonlocal spam" | |
def do_global(): | |
global spam | |
spam = "global spam" | |
spam = "test spam" |
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
#!/bin/bash | |
# Assumes a directory structure of: | |
# dir | |
# |-- skeleton | |
# | |-- testFile.java | |
# | +-- grade.sh (this file) | |
# | | |
# +-- testdata | |
# |-- input |
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
Blackbox testing: | |
Test background loads ok and is scrollable | |
Still scrollable with game objects. | |
Test implementation of buttons | |
Save, load | |
Save/load empty screen | |
Save/load one object (try different types) | |
Save/load one object of each type | |
Save/load with many objects |
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
// Hack for Kolor Game | |
// 1. Play the game at http://kolor.moro.es | |
// 2. Before clicking on "Start!", open up the JavaScript console and paste the following snippet of code. | |
// 3. WIN. | |
// Change the value for INTERVAL to have a faster refresh rate. | |
// Set AUTOPLAY to true to let the game play on its own, you lazy bum. | |
(function () { | |
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
/*! | |
jQuery.touchScrollBuster v0.0.1 | |
Tay Yang Shun https://github.com/yangshun | |
The MIT License (MIT) | |
Copyright (c) 2015 | |
$(el).touchScrollBuster() will prevent parent containers from scrolling | |
when the child container is at the top or at the bottom. | |
*/ |
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
{ | |
"parser": "babel-eslint", | |
"ecmaFeatures": { | |
"jsx": true, | |
"arrowFunctions": true, | |
"blockBindings": true, | |
"generators": true | |
}, | |
"rules": { | |
"accessor-pairs": 0, |
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
import { Component } from "React"; | |
export var Enhance = ComposedComponent => class extends Component { | |
constructor() { | |
this.state = { data: null }; | |
} | |
componentDidMount() { | |
this.setState({ data: 'Hello' }); | |
} | |
render() { |
OlderNewer