- "Print boarding pass" button does not work
- Uses Flash
- Non-native experience (weird scrolling, input fields, etc)
- Doesn't work on my phone
- Have to identify myself even though I'm already logged in on your website
- Too many steps, show my boarding pass on first screen
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
| var user = new User(); | |
| user.set("name", "parshap"); | |
| user.age("age", 5); | |
| // Only save "name" to Mongo - leave "age" as a modified path in the docuemnt | |
| user.save(["name"], function(err) { | |
| // ... | |
| }) |
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
| "use strict"; | |
| var type = require("core-util-is"); | |
| var slice = Array.prototype.slice; | |
| // Return a className string from the given arguments | |
| // | |
| // Example: | |
| // | |
| // classes("foo", "bar") -> "foo bar" |
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
| /** @jsx React.DOM */ | |
| "use strict"; | |
| // An <input /> component that applies a format function to the value | |
| // on initial render and when the element loses focus. | |
| // | |
| // Usage: | |
| // | |
| // <FormattedInput format={Math.round} valueLink={this.linkState("value")} /> | |
| // |
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 myCallback() { | |
| console.log(foo); // undefined | |
| } | |
| function dothing(callback) { | |
| var foo = "hello"; | |
| callback(); | |
| } |
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
| var React = require("react"); | |
| var TabbedComponent = React.createClass({ | |
| render: function() { | |
| return TabsContainer({ | |
| tabs: [ | |
| // Pass instantiated component? | |
| this.renderTab1(), | |
| // Or pass function to create component? | |
| this.renderTab1, |
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
| var a = [ | |
| 1, | |
| 2, | |
| 3, // <-- Trailing comma for easier future edits | |
| ]; | |
| // No trailing comma, adding a 4th element will require editing two lines | |
| var b = [ | |
| 1, | |
| 2, |
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
| var mongoose = require("mongoose"); | |
| var schema = new mongoose.Schema({ | |
| nestedProp: { | |
| bar: String, | |
| baz: String, | |
| }, | |
| }); | |
| var MyModel = mongoose.model("MyModel", schema); |
Taken from Naming Tips.
-
Do not name methods
ProcessData(). You only get to use this method name once per career, because you should have been fired immediately afterwards. Be specific about what it's doing inside; call itValidateUserCredentialsorEliminateDuplicateRequestsorComputeAverageAge, etc. -
Use naming to help you design the program. Pretend there's a rule saying "you can never write a
voidfunction", then think about all the steps your program makes to transform input into output, then chose names for those steps so you could make a written sentence with them. These are now your function names and the sentence is your program's structure.
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
| this.prevScrollTop = scroll.getScrollTop(); | |
| this.prevScrollLeft = scroll.getScrollLeft(); | |
| this.prevOverflow = window.document.body.style.overflow; | |
| window.document.body.style.overflow = "hidden"; | |
| window.scrollTo(0, 0); | |
| window.document.body.style.marginTop = px(-this.prevScrollTop); | |
| window.document.body.style.marginLeft = px(-this.prevScrollLeft); | |
| window.document.body.style.height = px(getWindowHeight() + this.prevScrollTop); | |
| window.document.body.style.width = px(getWindowWidth() + this.prevScrollLeft); | |
OlderNewer