With inspiration from Liberty University, https://wiki.openmrs.org/display/docs/Code+Review+Checklist, http://www.codeproject.com/Articles/593751/Code-Review-Checklist-and-Guidelines-for-Csharp-De.
- [ ]
| var stamper = function(queue) { | |
| var i = 0, | |
| waiting = false; | |
| function incr() { | |
| i += 1; | |
| waiting = false; | |
| } | |
| function incrAfter() { | |
| if (!waiting) { | |
| queue(incr); |
I have a public key whose fingerprint is BE83 68DF 6C48 11C0 385C 8590 B02D 3B27 D870 6A99
| impl Drop for PortMidi { | |
| fn drop(&mut self) { | |
| match portmidi::terminate() { | |
| Err(why) => panic!(why), | |
| Ok(_) => {/* nothing to do here */} | |
| } | |
| } | |
| } |
| /** | |
| * An example store to document sane conventions. | |
| * | |
| * Stores should implement these five methods at minimum. | |
| * Additional methods (eg., event handlers) may be added. | |
| * Never write directly to `this.data`, except in `init` | |
| * and `setData`. | |
| * | |
| * A few methods are allowed to be called by external |
| @app.route('/') | |
| def home(): | |
| return "hello world" | |
| ### OR ### | |
| def home(): | |
| return "hello world" | |
| app.route('/')(home) |
| my_list = [0, 1, 2, 3, 4, 5, 6] | |
| # if it's a very simple transformation, you can inline the function with `lambda` | |
| squared = map(lambda el: el**2, my_list) | |
| # squared should now be the list with all elements squared | |
| assert squared == [0, 1, 4, 9, 16, 25, 36] # passes, woo! | |
| interface Matchable { | |
| name: string; | |
| data: any[]; | |
| match: (options: ProjectActionMatcher) => any; | |
| } | |
| interface MatcherCatchAll { | |
| _: (...args: any[]) => any; | |
| } |
| import assert from 'assert'; | |
| import { MongoClient as mongoClient } from 'mongodb'; | |
| import thenAlways from './then-always'; | |
| /** | |
| * Use thenAlways to make a helper to safely initialize, use, and clean up a mongodb connection | |
| * @param {string} dbURI The mongodb test database to connect to | |
| * @param {func} doStuff A callback to run some tasks with the test database | |
| * @returns {Promise} A promise resolving or rejecting when everything's done | |
| */ |